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
flushSync
option.According to the
useNavigate
documentation, thenavigate
function accepts aflushSync
option that should wrap DOM updates inReactDOM.flushSync
.However, when using the underlying
Navigator.push()
andNavigator.replace()
methods (which powernavigate
), theflushSync
flag seems to be completely ignored — the navigation update is still batched/asynchronous.I expected with
flushSync: true
React 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