Skip to content

Commit ae90c25

Browse files
committed
Update HelloApi.tsx
1 parent 58674b5 commit ae90c25

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

MyApp.Client/src/_posts/components/HelloApi.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { useState, useEffect } from "react"
2-
import { JsonServiceClient } from "@servicestack/client"
3-
import { TextInput } from "@servicestack/react"
2+
import { TextInput, useClient } from "@servicestack/react"
43
import { Hello } from "@/dtos"
54

65
type Props = { value: string }
76
export default ({ value }:Props) => {
87
const [name, setName] = useState(value)
98
const [result, setResult] = useState('')
109

11-
const client = new JsonServiceClient()
10+
const client = useClient()
1211
useEffect(() => {
1312
(async () => {
1413
let api = await client.api(new Hello({ name }))

0 commit comments

Comments
 (0)