We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58674b5 commit ae90c25Copy full SHA for ae90c25
1 file changed
MyApp.Client/src/_posts/components/HelloApi.tsx
@@ -1,14 +1,13 @@
1
import { useState, useEffect } from "react"
2
-import { JsonServiceClient } from "@servicestack/client"
3
-import { TextInput } from "@servicestack/react"
+import { TextInput, useClient } from "@servicestack/react"
4
import { Hello } from "@/dtos"
5
6
type Props = { value: string }
7
export default ({ value }:Props) => {
8
const [name, setName] = useState(value)
9
const [result, setResult] = useState('')
10
11
- const client = new JsonServiceClient()
+ const client = useClient()
12
useEffect(() => {
13
(async () => {
14
let api = await client.api(new Hello({ name }))
0 commit comments