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

Usage with Remix #5

Open
na2hiro opened this issue May 1, 2024 · 2 comments
Open

Usage with Remix #5

na2hiro opened this issue May 1, 2024 · 2 comments

Comments

@na2hiro
Copy link
Contributor

na2hiro commented May 1, 2024

When I use in my Remix app, I get an error saying it's not wrapped with data router. If I copy paste ElementScrollRestoration and modify import from react-router-dom to @remix-run/react, it works.

useNavigation must be used within a data router. See https://reactrouter.com/routers/picking-a-router.

Can this library cover Remix usage as well?

Versions and setup

  • Remix: 2.3.0, 2.9.1
  • react-router-dom: 6.21.0
  • Vite
  • Custom express server
@kentcdodds
Copy link
Member

I'm using it with Remix currently and haven't run into that problem. Could be a new version issue. Definitely open to a pull request that supports both or even makes it a bit more generic if possible.

@na2hiro
Copy link
Contributor Author

na2hiro commented May 20, 2024

Probably the upcoming release of React Router v7 will let us import from react-router everywhere including Remix apps and fix this

https://remix.run/blog/merging-remix-and-react-router

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

No branches or pull requests

2 participants