#520·router

Unexpected remounting question

Author: bebbiCreated May 23, 2023Updated May 23, 2023

I think https://github.com/reach/router/issues/478 has a great question incl repro.

My use-case is to simulate an "optional parameter" in an editor that should not get remounted:

javascript
    <Router basepath="/">
      <Editor path="/" />
      <Editor path="/:someId" />
    </Router>

Once someId is processed, we navigate('/'). But then, the editor gets remounted and loses state. Can anyone help with the answer to the linked question?