Comments (18)
https://github.com/pbeshai/use-query-params/ solved react router v6 compatibilty
see:
https://github.com/pbeshai/use-query-params/blob/master/examples/react-router-6/src/index.js
pbeshai/use-query-params#196 (comment)
from use-route-as-state.
If you take a look to the historical version of react-router-dom, you can see they don't work a lot on version V5 anymore.
You can still create two branches, I think you won't have a lot of work to do for the version 5 in the futur.
About the version 6, you can see now on npm, that the version 6 is almost 3 times more downloaded than the version 5.
In my opinion, migrate to the version 6 it's a good option 👍
from use-route-as-state.
You should push your fork and open a PR.
Use gh pr create
with the Github CLI.
from use-route-as-state.
It's done.
from use-route-as-state.
I wrote my own package to handle state using search params with react-router-dom-v6
: https://github.com/jschwindt/react-use-search-params-state
from use-route-as-state.
useHistory -> useNavigate
useRouteMatch -> useMatch
from use-route-as-state.
Thanks, you're welcome to suggest a PR for it!
I will try to take it soon.
from use-route-as-state.
useMatch()
expects a parameter, whereas in use-route-as-state, useRouteMatch()
is called with no parameters, so it is not a direct replacement.
from use-route-as-state.
I need some help here.
If there are breaking changes in react-router-dom
, how can I support both v5 and v6 in my library? Do I need to create a separate branch and versions for that?
from use-route-as-state.
Hi @baruchiro
In my opinion, you shouldn't support V5 and V6 in same time in your library.
Create a new major version of you library who indicate that react-router v5 it's doesn't support anymore.
If someone want to use react-router V5, it can use the previous major version of your library.
from use-route-as-state.
Hi @s-roueche, thanks!
I think it means that I have two options. One is to stop supporting V5, and the other one is to maintain two branches.
Since V6 is still not stable and since the migration is a big issue, I think I need to choose option two.
WDYT?
from use-route-as-state.
If you want I started to implement the migration to v6 on a personal branch.
There are just 4 tests failed.... I don't really understand how to fixe it 😓
If you want I can push it on your repo ?
from use-route-as-state.
Yes, sure! Thank you, I will be happy to see your branch.
I also did some local work for the upgrade, and also failed on tests, you can see it here: #176.
from use-route-as-state.
I wasn't able to push my branch on your repo because I don't have the permission.
Can you give me the permission to do it ?
my username is @s-roueche
from use-route-as-state.
I wrote my own package to handle state using search params with
react-router-dom-v6
: https://github.com/jschwindt/react-use-search-params-state
@jschwindt Why not implement it here?
from use-route-as-state.
I wrote my own package to handle state using search params with
react-router-dom-v6
: https://github.com/jschwindt/react-use-search-params-state@jschwindt Why not implement it here?
I extracted it from an app that I was working on, and the usage is slightly different. I commented here just in case it is useful for somebody else.
from use-route-as-state.
Will there be a version compatible with v6 or will this be staying with v5?
from use-route-as-state.
I will deprecate this package.
from use-route-as-state.
Related Issues (18)
- Default values without change the route
- Add support for clear rest of params
- Set all defaults explicitly before the updated param
- '%' in URL leads to exception HOT 3
- What are the breaking changes of version 3? HOT 6
- Setting both query string key and route params in one render/effect does not work. HOT 5
- Add support for repeating query params (arrays) HOT 14
- The automated release is failing 🚨
- Can re-render be made independent, so that multiple hook calls re-render only the affected param? HOT 7
- Setting default values in URL HOT 3
- Create a release branch
- ChainAlert: Dependency "libnpmexec" version 3.0.2 has no matching tag in its git repo
- ChainAlert: Dependency "libnpmfund" version 2.0.2 has no matching tag in its git repo
- ChainAlert: Dependency "libnpmorg" version 3.0.0 has no matching tag in its git repo
- ChainAlert: Dependency "libnpmpublish" version 5.0.0 has no matching tag in its git repo
- Can't use with npm 8 and react 17 HOT 2
- ChainAlert: Dependency "lru-cache" version 7.4.0 has new "prepare" script
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-route-as-state.