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

Fixed React Router 6 support

Open phistuck opened this issue 5 years ago • 11 comments

This is an exploratory fix. It works, but I am not sure it is the right way to go.

phistuck avatar Jul 28 '20 09:07 phistuck

Due to the new history v5, listen history.listen became the following object instead of separate parameters: {location, action}. To fix this change line 62 on ConnectedRouter.js to:

const handleLocationChange = ({location, action}, isFirstRendering = false) => {

whazor avatar Feb 15 '21 10:02 whazor

@Whazor - hmmm, how is that different (it is already an object)? Unless I am blind, you just removed two line breaks...

phistuck avatar Feb 15 '21 15:02 phistuck

Ahhhh.. I applied your PR as patch to the latest version. But you are actually changing the dev branch.

whazor avatar Feb 15 '21 18:02 whazor

What is the status of this?

ayxos avatar Nov 09 '21 13:11 ayxos

I can recommend looking at redux-first-history or lagunovsky/redux-react-router

whazor avatar Nov 10 '21 10:11 whazor

Please merge this or update the connected-react-router to support v6

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

@supasate just click the button Merge !

tomtom94 avatar Oct 10 '22 10:10 tomtom94

go merge bro

Bender101 avatar Oct 14 '22 15:10 Bender101

Hey folks, can we expect that it is going to be merged anytime soon?

red17electro avatar Nov 28 '22 15:11 red17electro

Please merge this.. 😭

dhruvik077 avatar May 24 '23 07:05 dhruvik077

You don't need this module anymore, it is useless.

Just use the brand new React Router 6 hooks like useLocation, useNavigate, useParams etc... wherever you need it in your page.

I recommend you to take a look at this boilerplate repository for an app ready to go https://github.com/tomtom94/react-easy-ssr

tomtom94 avatar May 24 '23 08:05 tomtom94