Skip to content

[v6] Disable React.useTransition before cutting stable #7308

Closed
@gaearon

Description

@gaearon

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 the useTransition call. The tuple item order may change.

If React Router 6 goes stable with React.useTransition || polyfill, the moment we add React.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 to Array.prototype.contains -> Array.prototype.includes and global -> 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions