Replies: 2 comments
-
Apart of fetcher.data, there's also fetcher.state going from idle to submitting to idle again, also other parts of the router state needs to change and since React context has no way to only subscribe to a part of a value any internal state change in the router will cause a re-render. Remember that re-renders are not bad, slow renders are bad, if you component render fast enough there's no issue will letting it re-render many times. |
Beta Was this translation helpful? Give feedback.
-
I my case, I watch the fetcher data (wait the success message) to close the dialog(form in side) then toast the success message (expect once, but show the 4 times) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
when I use useFetcher in some submit, the server action return data, then I in the component use fetcher.data console.log in the chrome console print 4 times ?why
Beta Was this translation helpful? Give feedback.
All reactions