Skip to content

useSWR For CRUD operation #2021

Answered by swand0g
laurent512 asked this question in General
Discussion options

You must be logged in to vote

Take a look at disabling Revalidate on Focus in the SWR docs if you want to avoid lots data refresh – you could also look at toggling some more settings through the options object (which you can set as global config for all hook calls or pass in to individual hook calls)

In terms of other CRUD operations like POST and PUT looks like it's going to be in SWR 2.0 and a new hook useSWRMutation was added in #1450

Think it's been in 2.0 pre-releases since v2.0.0-beta.0 if you want to try it out

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by laurent512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants