Comments (3)
Thanks for your honest answer. I'll remove the lib from my project and consider using the next/router instead. But before this, I'm gonna leave a few PRs with code that made the lib work for me to some point.
from connected-next-router.
Hi @DZakh, I agree with your concern, one of the purposes of the library is to have an easy drop-in replacement for connected-react-router when migrating a codebase to Next.js, but this is a problem I've encountered myself for example in getInitialProps
where the route in the reducer is still the one you are currently in.
I don't think it would be right to set the location in routeChangeStart
, imagine that you have a page that displays the current location, and you navigate to another page with a getInitialProps
that takes 5 seconds to complete, the result I think we would see is the new location being displayed for those 5 seconds even when you haven't transitioned to the next page yet.
About why you should use the library, I have a similar conclusion to the one in react-redux-router README.
This library is not necessary for using Redux together with the Next Router. You can use the two together just fine without any additional libraries. It is useful if you care about recording, persisting, and replaying user actions, using time travel. If you don't care about these features, just can use Redux and Next Router directly.
I would like to make this library more useful, so I'm open to discuss ideas to solve this issue, including routeChangeStart
from connected-next-router.
@DZakh Thanks for bringing this up. This should be fixed in V4 with the changes in patchRouter
. There's now a test case that ensures Next Router state and the router state in Redux are equal on page load / navigation.
connected-next-router/src/patchRouter.ts
Line 22 in 309f144
from connected-next-router.
Related Issues (20)
- Support for Next 13/React 18? HOT 5
- ModuleNotFoundError: Module not found: HOT 9
- Doesn't support NextJS 9.0.5 HOT 1
- Example without `next-redux-wrapper` HOT 6
- Requests with query parameters are being redirected to / HOT 4
- Option to change action types names HOT 1
- Feature request: createMatchSelector to replace connected-react-router HOT 8
- my push method from next/router not working properly as expected after wrapping my app with ConnectedRouter HOT 12
- [Question] How to get URL parts in a Reducer? HOT 4
- react-router migration question HOT 2
- search.replace is not a function HOT 3
- Doesn't consider basePath? HOT 3
- Redux-undo?
- Redux Toolkit HOT 3
- Export a NextRouterState type for TypeScript?
- Expose a LocationChangeAction type for TypeScript? HOT 3
- doesn't work with React 18+ HOT 3
- Redux Persist
- peer dependency issue with react-redux@8 HOT 1
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 connected-next-router.