Skip to content

How eventsRef.current.emit ensures that code is not run during rendering? #533

Discussion options

You must be logged in to vote

The onSuccess callback is only executed by revalidate, which is called inside this effect https://github.com/vercel/swr/blob/master/src/use-swr.ts#L408 and inside the mutate function, for the mutate function is not a problem because you usually run that function inside an effect or an event handler.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

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