remix icon indicating copy to clipboard operation
remix copied to clipboard

Routing V2 sub-route outlet doesn't show embedded in parent route

Open MajorTom327 opened this issue 2 years ago • 2 comments

What version of Remix are you using?

1.11.1

Steps to Reproduce

I'ved make a simple repo for the reproduction of this problem: https://github.com/MajorTom327/remix-route-v2-tests

The routes presents are:

profile/index.tsx
profile.general/index.tsx
profile.security/index.tsx
_index.tsx

The profile/index.tsx is a simple route that have 2 NavLink to the route general and security. profile.general/index.tsx and profile.security are simple subroute with different text to show.

The objective is to make a interface with pane or tab to navigate through sub-sections of the profile.

Click on any link in the profile section show the correct page but the links in the parent route disappear.

Expected Behavior

The parent route should still be visible with the nav-links inside them. The child route should be in the Outlet

Actual Behavior

Navigate through the sub-route work, but the parent layout is not show.

MajorTom327 avatar Jan 21 '23 14:01 MajorTom327

It appears folders exhibit v1 behavior, even with v2_routeConvention flag.

v2_routeConvention flagged:

  • Files, working as expected: https://stackblitz.com/edit/node-nevrec
  • Folders shouldn't allow nesting: https://stackblitz.com/edit/node-vccmqv

xHomu avatar Jan 23 '23 00:01 xHomu

That can explain my secondary problem:

profile/index.tsx
profile.[_general]/index.tsx
profile.[_security]/index.tsx

Throwing an error on build like the escaping special chars doesn't work either. image

MajorTom327 avatar Jan 23 '23 11:01 MajorTom327

A way to bypass the original problem: Keep your parent route as a file, but you can use children route with the directory version

Like this:

profile.tsx
profile.general/index.tsx
profile.security/index.tsx
_index.tsx

That work fine. (But still not ok for profile route as a directory)

MajorTom327 avatar Jan 30 '23 17:01 MajorTom327

Closed by #5228

MichaelDeBoey avatar Feb 06 '23 22:02 MichaelDeBoey

🤖 Hello there,

We just published version v0.0.0-nightly-a024557-20230207 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

github-actions[bot] avatar Feb 07 '23 07:02 github-actions[bot]