router icon indicating copy to clipboard operation
router copied to clipboard

Nested Routers

Open posva opened this issue 4 years ago • 6 comments

What problem does this feature solve?

Allow using nested memory routers to handle independent views. e.g. the messages on Twitter, or a chat.

A custom History implementation could even save the current page in local storage and restore it when reopening the app.

What does the proposed API look like?

provideRouter(createRouter(...))
// or
createNestedRouter(baseRouterOptions)
  • Could warn if history is based on HTML5
  • No initial navigation
  • Should provide these
  • Could appear in devtools
  • Could automatically unregister the history listener on unmounted
  • Should not change global configs
  • Should still be able to access the global router

posva avatar Aug 23 '21 20:08 posva

This would have to go through an RFC to better identify the different needs of creation/destruction of nested routers.

posva avatar Aug 23 '21 20:08 posva