-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[v6] Disable React.useTransition before cutting stable #7308
Comments
What React will probably do is start prefixing all our experimental APIs again. Even if they only exist in the Experimental releases. When we added the Experimental releases, we figured it was ok to start shipping un-prefixed experiments there, since they don't affect the main, stable release channel. But we hadn't really considered that third party projects would use feature detection in their stable releases. I can see why it seems harmless, though, so it's not really your fault. To make feature detection less tempting, looks like we're going to start prefixing again :) |
Also I know v6 isn't stable yet, just made us realize that this could easily happen in some other project. Or if y'all accidentally forgot to remove it before the stable release. |
We're still a ways out from even going beta (M+R are focused on Remix right now), but I'll make sure this gets swapped out later. How should we be handling this polyfill? We can restrict a certain |
I think the best strategy for us right now is probably just to back out anything to do with Using the |
For reference: facebook/react#18825 |
- Moved history.listen calls into BrowerRouter, HashRouter, and MemoryRouter components and added <Router location> prop - Use useLayoutEffect cleanup callback to teardown the listener - Removed useTransition shim and timeout props. Will integrate this later in a new "experimental" release channel Fixes #7195 Fixes #7308
The |
React 18 is now released with a stable |
Hey folks!
Noticed that v6 has this feature check:
https://github.com/ReactTraining/react-router/blob/5bef342de8fe3a7c132edf9cbab1464fda840399/packages/react-router/index.js#L172-L173
While this is exciting and is something we'll definitely want after
useTransition
is stable, it is really important that the v6 stable release does not ship with this check.The reason is that
useTransition
API itself is still not finalized. For example, the config might move into theuseTransition
call. The tuple item order may change.If React Router 6 goes stable with
React.useTransition || polyfill
, the moment we addReact.useTransition
as a stable API, all existing React Router 6 apps will switch to it automatically. So we would become locked into our current signature.As a result, we may have to end up renaming
useTransition
to avoid a breaking change. Similar toArray.prototype.contains
->Array.prototype.includes
andglobal
->globalThis
. It would be nice if we could avoid this.I'm not sure what's the best strategy if you'd like this to work with
experimental
React releases in the meantime. We can probably figure something out though.Thank you!
The text was updated successfully, but these errors were encountered: