Skip to content
Discussion options

You must be logged in to vote

@scucchiero
What about using the conditional fetch?
https://swr.vercel.app/docs/conditional-fetching#conditional

const [query, setQuery] = useState("")
const { data: results } = useSWR(query ? '/search' + query : null, fetcher)

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@scucchiero
Comment options

Answer selected by scucchiero
Comment options

You must be logged in to vote
2 replies
@huozhi
Comment options

@shuding
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
5 participants