Skip to content
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

Remove duplicate RouterProvider implementations #11679

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

brophdawg11
Copy link
Contributor

We used to have 2 of these since we kept DOM-specifics in react-router-dom (document.startViewTransition, ReactDOM.flushSync) but now we just need the one and it can be defensive against the lack of window/document

Copy link

changeset-bot bot commented Jun 18, 2024

🦋 Changeset detected

Latest commit: 2c6c99e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
react-router Major
react-router-dom Major
@react-router/dev Major
@react-router/server-runtime Major
@react-router/node Major
@react-router/express Major
@react-router/serve Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +2 to 9

// TODO: This static import doesn't allow us to work quite right in a pure-react
// app that doesn't even have react-dom as a dependency. Let's look into using
// an export map for `react-router/dom that would provide the `flushSync` method
// to the memory `<RouterProvider>` via a prop. And then
// `import { RouterProvider } from 'react-router/memory'` // memory use case
// `import { RouterProvider } from 'react-router/dom'` // DOM use case
import * as ReactDOM from "react-dom";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to figure out what to do here - putting this on hold until we can discuss the export map setup next week with @mjackson and @markdalgleish

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merge this PR and make an issue for this?

@brophdawg11 brophdawg11 merged commit defd48f into v7 Jun 20, 2024
5 checks passed
@brophdawg11 brophdawg11 deleted the brophdawg11/dedup-router-provider branch June 20, 2024 17:18
Copy link
Contributor

🤖 Hello there,

We just published version 6.28.2-pre.0 which includes this pull request. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants