-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Closed
Description
Issue
We have a widget system where the history needs to be shared between all of them. Currently the new Routers (Browser, Hash and Memory) do not have any option to pass an already existent history, which will be used instead of always creating a new one.
Suggestion
Is there a good reason why not extend these Routers with an additional history prop, which will be used in the following lines:
- For MemoryRouter: https://github.com/ReactTraining/react-router/blob/262b45dd8d6cbdc3a984259c5591ffc3de80d600/packages/react-router/index.tsx#L124
- For HashRouter: https://github.com/ReactTraining/react-router/blob/262b45dd8d6cbdc3a984259c5591ffc3de80d600/packages/react-router-dom/index.tsx#L139
- For BrowserRouter: https://github.com/ReactTraining/react-router/blob/262b45dd8d6cbdc3a984259c5591ffc3de80d600/packages/react-router-dom/index.tsx#L95
like this:
history || createXXXHistory()
Thank you.
Metadata
Metadata
Assignees
Labels
No labels