test: modify sample code
This commit is contained in:
parent
3c81be16ce
commit
4820d668ba
@ -257,7 +257,7 @@ export default function Playground() {
|
|||||||
const [callFlag, setCallFlag] = useState(false)
|
const [callFlag, setCallFlag] = useState(false)
|
||||||
// const { data: tutoData, error, isLoadin g } = useSWR('http://localhost:8080/api/tutorial', getFetcher)
|
// const { data: tutoData, error, isLoadin g } = useSWR('http://localhost:8080/api/tutorial', getFetcher)
|
||||||
const { data: tutoData, error, isLoading } = useSWR(callFlag ? 'http://localhost:8080/api/tutorial' : null, getFetcher)
|
const { data: tutoData, error, isLoading } = useSWR(callFlag ? 'http://localhost:8080/api/tutorial' : null, getFetcher)
|
||||||
const { trigger, isMutating: postIsMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher)
|
const { trigger, isMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher)
|
||||||
|
|
||||||
if (isLoading) {
|
if (isLoading) {
|
||||||
return <div>Loading...</div>
|
return <div>Loading...</div>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user