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

React-router 6.0.0-beta.0 throws an error #40

Closed
Ethorsen opened this issue Feb 5, 2021 · 4 comments
Closed

React-router 6.0.0-beta.0 throws an error #40

Ethorsen opened this issue Feb 5, 2021 · 4 comments

Comments

@Ethorsen
Copy link

Ethorsen commented Feb 5, 2021

Hi @salvoravida,

Thx for this great module.

There is an error right out of the box with the latest react-router beta.

Screenshot_1

As shown in this sandbox.

https://codesandbox.io/s/proud-hill-e6kn2

Thx

@salvoravida
Copy link
Owner

salvoravida commented Feb 5, 2021

Hi @Ethorsen, the problem is that v beta has a breaking change from v alpha.
I have already opened a pr on react router page six months ago.
remix-run/react-router#7586
I cannot fix rfh, without that pr merged. Feel free to stress them.. 😅

@Ethorsen
Copy link
Author

Ethorsen commented Feb 5, 2021

Ok. No stress thx for the follow-up.

I'll stick with react-router 5.2.0 for now as my actual project wont grow that big. It will be trivial to do the switch once its all figured out.

Thx

@Ethorsen
Copy link
Author

Ethorsen commented Aug 4, 2021

Does it mean your PR with react-router is to be merged soon?

@salvoravida
Copy link
Owner

  • rewritten in TS
  • add support for react-router v6.0.0-beta.1
import { HistoryRouter as Router } from "redux-first-history/rr6";
import { Route, Routes, Navigate } from "react-router-dom";
//...
import { store, history } from "./store";
//...

     <Router history={history}>
                 <Routes>
                   <Route path="/dashboard" element={<Dashboard />} />
                   <Route path="/" element={<Home />} />
                   <Route path="*" element={<Navigate to="/" />} />
                 </Routes>
     </Router>

demo rr6 here: https://codesandbox.io/s/redux-first-history-demo-rr6-uccuw

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