add swr tutorial
This commit is contained in:
parent
8182ce42ba
commit
0e7fd7cb77
@ -267,8 +267,8 @@ export default function Playground() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const [getFetcherCallFlag, setGetFetcherCallFlag] = useState(false)
|
const [getFetcherCallFlag, setGetFetcherCallFlag] = useState(false)
|
||||||
const { data: tutoData, error, isLoading } = useSWR('http://localhost:3000/api/swr-tutorial', getFetcher)
|
const { data: tutoData, error, isLoading } = useSWR('http://localhost:8080/api/tutorial', getFetcher)
|
||||||
const { trigger, isMutating } = useSWRMutation('http://localhost:3000/api/swr-tutorial', postFetcher)
|
const { trigger, isMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user