Replies: 1 comment 3 replies
-
// imperative
useEffect(() => {
if (fetcher.type === 'done') {
showToast()
}
}, [fetcher.type])
// declarative
{ fetcher.type === 'done' ? <Toast/> : null } |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Any way to run some code after a successful call to
fetcher.submit(data)
? Trying to show a toast whenever the request is successful and the only way I can figure out how to do it is checking the data infetcher
Beta Was this translation helpful? Give feedback.
All reactions