atlassian-labs / react-resource-router

Configuration driven routing solution for React SPAs that manages route matching, data fetching and progressive rendering
https://atlassian-labs.github.io/react-resource-router
Apache License 2.0
198 stars 28 forks source link

No longer recreating histories within MemoryRouter #151

Open PatrickShaw opened 2 years ago

PatrickShaw commented 2 years ago

Similar to #150 I don't think we want to create a new memory history on every render of MemoryRouter. Memory history is supposed to maintain state outside the lifetime of a single render.

I've fixed this issue by putting useRef around the createMemoryHistory to retain the same instance.