useNavigate with option flushSync #14320
Unanswered
kruchininfl
asked this question in
Q&A
Replies: 0 comments
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.
-
Hi!
I noticed some unexpected behavior regarding the
flushSyncoption.According to the
useNavigatedocumentation, thenavigatefunction accepts aflushSyncoption that should wrap DOM updates inReactDOM.flushSync.However, when using the underlying
Navigator.push()andNavigator.replace()methods (which powernavigate), theflushSyncflag seems to be completely ignored — the navigation update is still batched/asynchronous.I expected with
flushSync: trueReact should synchronously render components with the new context (location, params, etc.).Is this a bug or the intended behavior?
Beta Was this translation helpful? Give feedback.
All reactions