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

Support react router 6 #543

Open
Iuriy-Budnikov opened this issue Nov 4, 2021 · 19 comments
Open

Support react router 6 #543

Iuriy-Budnikov opened this issue Nov 4, 2021 · 19 comments

Comments

@Iuriy-Budnikov
Copy link

Do you have any plans to support 6 version? Do you need any help?
https://reactrouter.com

@rubenswyerstcs
Copy link

Looks like #438 is aimed at doing that but has been left alone, I may apply that as a patch to the latest version myself to resolve the immediate issue

@sergeushenecz
Copy link

sergeushenecz commented Nov 4, 2021

After upgrade react-router-dom 5.3.0 to 6.0.0 i have error.
Cannot read properties of undefined (reading 'pathname')
image

Is It problem in connected-react-router or not?

@salvoravida
Copy link

salvoravida commented Nov 10, 2021

Switch to redux-first-history: https://github.com/salvoravida/redux-first-history
support react-router v6 and is issues-free!

@Iuriy-Budnikov
Copy link
Author

Switch to redux-fist-history: https://github.com/salvoravida/redux-first-history support react-router v6 and is issues-free!

Thanks! I'll play with it.

@sergeushenecz
Copy link

@Iuriy-Budnikov Could you write after your result after migrate

@salvoravida
Copy link

Switch to redux-fist-history: https://github.com/salvoravida/redux-first-history support react-router v6 and is issues-free!

Thanks! I'll play with it.

Great, looking forward to your feedback!

@sergeushenecz
Copy link

@salvoravida @Iuriy-Budnikov I moved to redux-first-history and all good works as excepted. Migration was smooth.

@salvoravida
Copy link

@salvoravida @Iuriy-Budnikov I moved to redux-first-history and all good works as excepted. Migration was smooth.

update to 5.0.2 that fixes support for react-router 6.0.2 while waiting for this official Pull Request remix-run/react-router#7586

let me know your feedback!

@sergeushenecz
Copy link

@salvoravida Updated to 5.0.2 and react router 6.0.2 all good

@yoyo837
Copy link

yoyo837 commented Nov 15, 2021

Same as #397

@Iuriy-Budnikov
Copy link
Author

Hey @salvoravida,
Thanks. I switched successfully.

@lovewinders
Copy link

I have the same problem, I think it does not support react-router V6

@zygimantas-gylys
Copy link

I have a same problem ant that case is with interfaces.

RouterLocation<S> extends Location<S>

Problem that extending Location interface with not a generic and passing S generic from RouterLocation. At this moment, that breaks Location interface and we lost all Location properties.

export interface RouterLocation<S> extends Location<S> {
    query: Record<string, string>
  }

  export interface RouterState<S = LocationState> {
    location: RouterLocation<S>
    action: RouterActionType
  }

@Ali-Aref
Copy link

Ali-Aref commented Jan 9, 2022

Switch to redux-first-history: https://github.com/salvoravida/redux-first-history support react-router v6 and is issues-free!

Just tried it now, It's great and loved the clear guides ❤️!

@lagunovsky
Copy link

@lovewinders @zygimantas-gylys

You can try https://github.com/lagunovsky/redux-react-router
Requires react-router v6 and history v5

API like for the connected-react-router

UberOpenSourceBot pushed a commit to fusionjs/fusionjs that referenced this issue Feb 17, 2022
This PR is in preparation of upgrading `react-router` inside of `fusion-plugin-react-router` to 6.x.

`connected-router` does not support react-router 6 and going by the github repo commits and issues, they have no plans to. See supasate/connected-react-router#543. Seems like community members are migrating to other solutions.

In lieu of this, this PR pins this plugin to the latest version of `fusion-plugin-react-router` to serve as a time capsule for whomever still wants to use this. That way when we upgrade `fusion-plugin-react-router` it won't break this plugin.

Alternatively, there is potential work to migrate this plugin to use something else under the hood that supports react router 6 but to me that should be an entirely new plugin instead of continuing to work on this one.
@rjmohammad
Copy link

@supasate is it fair to assume there will be no updates to this package going forward?

lijim added a commit to lijim/monks-and-mages that referenced this issue Feb 25, 2022
After some agonizing, I discovered that the latest version of react-router-dom (v6) is supported by redux-first-history

Connected-react-router seems to have not been maintained to support react-router v6: supasate/connected-react-router#543
@monecchi
Copy link

monecchi commented Apr 5, 2022

New React/Redux project here totally dependent on react-router-dom v6. Successfully switched to redux-first-history and that solved the issue! Thanks for the tip!!

@SouroucheB
Copy link

Hi everyone,

I'm still strugling myself on this Cannot read properties of undefined (reading 'pathname') console error.
I've followed the migration v6 guide here : https://github.com/remix-run/react-router/blob/main/docs/upgrading/v5.md#upgrade-to-react-router-v6
I've update all my yarn packages such as React and react-dom (18.1.0), react-router and react-router-dom (6.3.0) and I'm always getting the exact same error in my console when I lauch my app with react-scripts start !

Does anyone can help me please ?

@tomtom94
Copy link

tomtom94 commented Oct 10, 2022

The PR has been created 1 year ago. WTF ? #438

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