|
4 | 4 |
|
5 | 5 | 👨💼 Great! Now we can customize the meta tags on our routes! Let's do a bit more
|
6 | 6 | for our profile pages.
|
| 7 | + |
| 8 | +<callout-info> |
| 9 | + 🦉 You'll notice that if you navigate to the `/users/kody` route, you'll see |
| 10 | + the `Profile | Epic Notes` in the title. But you'll see only `Epic Notes` |
| 11 | + when you navigate to one of its child URLs, like `/users/kody/notes`. It |
| 12 | + behaves like that because, regardless the 2 URLs have a parent-child |
| 13 | + relationship, in terms of layout, `/users/kody/notes` is not a child of |
| 14 | + `/users/kody`. Remember that the latter folder path is defined like this: |
| 15 | + `routes/users+/$username.tsx` while the former's path is |
| 16 | + `routes/users+/$username_+/notes.tsx`. That little underscore in the name of |
| 17 | + the folder `$username_+` means that the pages inside will skip using the |
| 18 | + layout defined in the `routes/users+/$username.tsx` file. In other words, |
| 19 | + they won't be "layout-nested", even if they will be "url-nested". And, because |
| 20 | + they won't be layout-nested, they won't inherit the meta override defined |
| 21 | + in the `routes/users+/$username.tsx`, following, instead, the meta override |
| 22 | + defined in the `routes/root.tsx` which is its parent regarding layout. One way |
| 23 | + of seeing the layout parent-child relationships is by typing the |
| 24 | + `npx remix routes` in a terminal at the root of a remix project to see how |
| 25 | + the routes will be configured. It should give you a better view of the |
| 26 | + router layout-nesting structure. |
| 27 | +</callout-info> |
0 commit comments