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

[Bug]: MemoryRouter looses state of initial entries in v6.4.0

Open ddolcimascolo opened this issue 4 years ago • 8 comments

What version of React Router are you using?

6.4.0

Steps to Reproduce

See the Sandbox at https://codesandbox.io/s/react-router-issue-9265-p8nx49 and simply downgrade react-router-dom to v6.3.0 to see the state value being rendered.

Expected Behavior

MemoryRouter does not loose state of initial entries.

Actual Behavior

MemoryRouter looses state of initial entries.

ddolcimascolo avatar Sep 15 '22 07:09 ddolcimascolo

This breaks Jest tests basically, where we use <MemoryRouter />.
The production application use <BrowserRouter /> is not impacted and works fine in v6.4.0.

ddolcimascolo avatar Sep 15 '22 07:09 ddolcimascolo

Am I the only one blocked by this?

Remix team, do you think this is something that can be fixed by someone that has never contributed to react-router? :)

ddolcimascolo avatar Sep 15 '22 12:09 ddolcimascolo

We are experiencing the same issue where we use the memory router with some initial state within our cypress component tests.

CarloHagens avatar Sep 15 '22 13:09 CarloHagens

@timdorr I saw your answer in https://github.com/remix-run/react-router/issues/9273. Any chance this regression has the same cause?

ddolcimascolo avatar Sep 16 '22 05:09 ddolcimascolo

Thanks for the bug report and reproduction! Pushed a fix for this in #9288 and we should be able to get a patch out early this week 👍

brophdawg11 avatar Sep 17 '22 19:09 brophdawg11

@brophdawg11 Is a release still planned this week?

ddolcimascolo avatar Sep 21 '22 08:09 ddolcimascolo

Thx for the release!

ddolcimascolo avatar Sep 22 '22 05:09 ddolcimascolo

👍 let us know if you run into any issues in 6.4.1!

brophdawg11 avatar Sep 22 '22 11:09 brophdawg11