github molefrog/wouter v3.3.0
Route parameters inheritance

latest releases: v3.3.5, v3.3.4, v3.3.3...
4 months ago

Parameters provided by a Route component or received from calling useParams now also contain values inherited from parent nested routes. See #461 and #409.

Example:

// given the location is "/blog/1/users/4"

<Route path="/:page/:id" nest>
  <Route path="/users/:id">
     {/* calling `useParams()` here will return an object containing `{ page: "blog", id: "4" }`
     {/* note: duplicate keys are overwritten by the inner-most route */}
  </Route>
</Route>

Don't miss a new wouter release

NewReleases is sending notifications on new releases.