Allow opting out of startTransition #12855
Replies: 2 comments 2 replies
-
I'm using "createBrowserRouter" in a Redux app. The app is quite up to date, with latest versions of React Redux, RTK Query, etc etc. However, I'm definitely seeing some weird behavior when trying to upgrade to v7. I'm on the second attempt now, and I'm thinking I might just have to drop it until this opt-out is supported. I'm not sure Redux is considered concurrent safe these days? Please allow for opting out of startTransition. Any chance of this being supported @brophdawg11 ? |
Beta Was this translation helpful? Give feedback.
-
After looking into the code of RouterProvider a bit I noticed that you can provide a flushSync implementation, so that when providing "flushSync: true" on router.navigate calls you can actually opt-out of startTransition for some of the navigation at least. |
Beta Was this translation helpful? Give feedback.
-
Original issue here #12552, and paraphrasing my comment directly:
After a few unsuccessful attempts to migrate to v7, my thoughts are still the same.
This issue can be solved in one of the two ways:
startTransition
.startTransition
, but internally useuseDeferredValue
to get the router state. Expose another hook likeuseLocationSync
that can get the non-deferred router state so that users can opt-out and build their custom hooks upon that. This is more effort and I don't know if it would work well.I think
startTransition
is incompatible with most client-side applications, and it will be too late when people start noticing this. Please don't let this be another nail in the coffin for client-side React.Beta Was this translation helpful? Give feedback.
All reactions