Skip to content

Using useSWR() without key Doesn't return any data #2808

Answered by koba04
mohanas-scg asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, that is correct; we use the key internally to store data like cache and some internal state.
You can also pass a non-URL string as the key.

useSWR("product", getData);

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@mohanas-scg
Comment options

@koba04
Comment options

Answer selected by mohanas-scg
@mohanas-scg
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants