State Management · Junior · Question 48 of 75

What are the arguments of useSWR(key, fetcher)?

Explanation

const { data, error, isLoading } = useSWR('/api/user', fetcher). The key identifies the cache entry: every component using the same key shares one request and one cached value.

Further reading

Problem with a question

State Management · Junior · question 48

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz