remix
remix copied to clipboard
Routing V2 sub-route outlet doesn't show embedded in parent route
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.
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
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.
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)
Closed by #5228
🤖 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!