supasate / connected-react-router

A Redux binding for React Router v4
MIT License
4.73k stars 592 forks source link

Support react router 6 #543

Open Iuriy-Budnikov opened 2 years ago

Iuriy-Budnikov commented 2 years ago

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

rubenswyerstcs commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Iuriy-Budnikov commented 2 years ago

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 commented 2 years ago

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

salvoravida commented 2 years ago

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 commented 2 years ago

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

salvoravida commented 2 years ago

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

sergeushenecz commented 2 years ago

@salvoravida Updated to 5.0.2 and react router 6.0.2 all good

yoyo837 commented 2 years ago

Same as #397

Iuriy-Budnikov commented 2 years ago

Hey @salvoravida, Thanks. I switched successfully.

lovewinders commented 2 years ago

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

zygimantas-gylys commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

@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

rjmohammad commented 2 years ago

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

monecchi commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

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