connected-react-router icon indicating copy to clipboard operation
connected-react-router copied to clipboard

Support react router 6

Open Iuriy-Budnikov opened this issue 4 years ago • 19 comments

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

Iuriy-Budnikov avatar Nov 04 '21 09:11 Iuriy-Budnikov

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

rubenswyerstcs avatar Nov 04 '21 13:11 rubenswyerstcs

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?

sergeushenecz avatar Nov 04 '21 16:11 sergeushenecz

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

salvoravida avatar Nov 10 '21 08:11 salvoravida

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.

Iuriy-Budnikov avatar Nov 10 '21 09:11 Iuriy-Budnikov

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

sergeushenecz avatar Nov 10 '21 09:11 sergeushenecz

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!

salvoravida avatar Nov 10 '21 09:11 salvoravida

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

sergeushenecz avatar Nov 13 '21 13:11 sergeushenecz

@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 https://github.com/remix-run/react-router/pull/7586

let me know your feedback!

salvoravida avatar Nov 13 '21 14:11 salvoravida

@salvoravida Updated to 5.0.2 and react router 6.0.2 all good

sergeushenecz avatar Nov 14 '21 13:11 sergeushenecz

Same as #397

yoyo837 avatar Nov 15 '21 02:11 yoyo837

Hey @salvoravida, Thanks. I switched successfully.

Iuriy-Budnikov avatar Nov 23 '21 08:11 Iuriy-Budnikov

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

lovewinders avatar Nov 30 '21 11:11 lovewinders

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
  }

zygimantas-gylys avatar Dec 02 '21 12:12 zygimantas-gylys

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 ❤️!

Ali-Aref avatar Jan 09 '22 08:01 Ali-Aref

@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

lagunovsky avatar Jan 13 '22 04:01 lagunovsky

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

rjmohammad avatar Feb 23 '22 08:02 rjmohammad

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!!

monecchi avatar Apr 05 '22 06:04 monecchi

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 ?

SouroucheB avatar May 09 '22 13:05 SouroucheB

The PR has been created 1 year ago. WTF ? https://github.com/supasate/connected-react-router/pull/438

tomtom94 avatar Oct 10 '22 09:10 tomtom94