State Management · Middle · Question 41 of 75

What does mutate(key) from useSWRConfig do?

Explanation

After a POST you call mutate('/api/todos') so every component using that key refetches. You can also pass new data to update the cache immediately, and the bound mutate from useSWR updates its own key.

Further reading

Problem with a question

State Management · Middle · question 41

Test yourself

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

Take this quiz