Skip to content

Nested Router support? #342

Closed
Closed

Description

@Brendan-csel

Prior to version 0.10 we've used nested <Routes> to (lazily) apply additional routes for customer-specific sections of our apps.

The recommendation from 0.10 onwards was to use nested <Router> with appropriate base properties. The seem to be issues with this approach.

I've put together a stackblitz example in an attempt to provide a concise example for exploring the various issues:

  1. Nested router home page not rendering on first navigation (only on refresh).
  2. Nested router's other routes not rendering ever.
  3. <A> links get offset from nearest nested router - but need to be able to router globally within the app (outside the nested router).
  4. The root router seems to be handling all anchor clicks so the nested router never gets a shot at them.

Open the stackblitz example and follow the notes on each page. Preview in a new tab to better see the url.

Supporting additional routes loaded more deeply/lazily within the app is a valid use-case. Is it possible to continue supporting that somehow?

Other likely related issues:
#334
#255

Activity

  1. changed the title [-]Nested Router issues[/-] [+]Nested Router support?[/+] on Dec 29, 2023
  2. Brendan-csel commented on Dec 29, 2023

    @Brendan-csel
    ContributorAuthor

    Perhaps this should actually be a discussion until it is decided nested Routers should even be a supported thing? I guess the current positions is they're not.

  3. ryansolid commented on Jan 3, 2024

    @ryansolid
    Member

    Perhaps this should actually be a discussion until it is decided nested Routers should even be a supported thing? I guess the current positions is they're not.

    I think so. The last bit of making this call was looking at Tanstack Router. It is pretty awkward nesting doesn't work. But I suspect it hasn't worked for a long long time. Like years. Ever since we did anchor delegation ie point 4. I think point 3 above is pretty much the deal breaker isn't it. Cause there is no way that would work properly. I should probably remove that nested Router comment in the Readme.

  4. Brendan-csel commented on Jan 12, 2024

    @Brendan-csel
    ContributorAuthor
  5. locked and limited conversation to collaborators on Jan 31, 2024
  6. converted this issue into a discussion #362 on Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions