-
Notifications
You must be signed in to change notification settings - Fork 594
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
Missing <Link> component? #297
Comments
I'm in the exact same situation. I followed every step here https://github.com/supasate/connected-react-router#usage |
Usually when that happens it means that the history is not the same. Make sure you have the right setup on the history->store->provider->router Anyway, I am still having troubles using the latest version of connected-react-route. I had to rollback to version 4.5. |
@xesf Wait, are you saying that react-router's Link component is actually supposed to work even if introducing connected-react-router into the mix? |
It always worked for me, even the old version. I have a component library that has the reference of Link from a Button component. The lib is then used in the apps which include the connected react router. I mainly use connected router to dispatch routes from sagas, while using Links in most of the cases from View components. I do have exceptions where from components I dispatch to router as well. |
I had this problem because I had a |
@zjr thank u for pointing this out! I have my |
@chenyil, you will have to remove the BrowserRoute has pointed in step 3 of the readme and make sure you have a share history with store and connected router. |
Thank you, @xesf I can't remove Wrapper component:
App.js
|
The best choice will be to ask for an extension of customRouter to be an outside component, instead of a default div, if you cannot access either App or Wrapper components. |
I no longer have the problem after upgrading to the latest version. |
This is not neccessarily a problem with
connected-react-router
- chances are that I'm just not "getting it".I've got everything set up and working beautifully. However, working with
onClick={() => push("/foo")}
everywhere felt like a step back from just using<Link to="/foo">
fromreact-router
. However, usingreact-router
'sLink
component no longer works - the browser navigates, but the Redux state doesn't change.Thus, I created my own Link component, like this:
Is that a valid approach? Shouldn't such a component even be part of
connected-react-router
?The text was updated successfully, but these errors were encountered: