test: modify sample code

This commit is contained in:
nalpari 2025-01-15 15:26:04 +09:00
parent 3c81be16ce
commit 4820d668ba

View File

@ -257,7 +257,7 @@ export default function Playground() {
const [callFlag, setCallFlag] = useState(false)
// 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 { trigger, isMutating: postIsMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher)
const { trigger, isMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher)
if (isLoading) {
return <div>Loading...</div>