solidjs / solid-docs-next

SolidJS Docs.
https://docs.solidjs.com/
208 stars 225 forks source link

[Content]: Nested routes text does not match examples #758

Open klequis opened 1 month ago

klequis commented 1 month ago

📚 Subject area/topic

SolidStart > Routing > Nested routes

📋 Page(s) affected (or suggested, for new content)

https://docs.solidjs.com/solid-start/building-your-application/routing#nested-routes

📋 Description of content that is out-of-date or incorrect

In this sentence:

"If you need nested routes, you can create a directory with the name of the preceding route segment, and create new files in that directory:"

Says, "create a directory with the name of the preceding route".

This is unclear or incorrect. None of the examples show a "directory with the name of the preceding route".

Let me know if I am correct. If so, I'm happy to create a suggestion for correction.

Cheers.

🖥️ Reproduction in StackBlitz (if reporting incorrect content or code samples)

n/a

klequis commented 1 week ago

I would create a PR for this but I have more questions than answers...

Some additional thoughts on the section Nested routes.

Applies to solid start.

I've been over the Solid doc on nested routes, read about them in React Router and some other sources as well and I still am not sure what they are other than a route with more than one segment:

example 1 Not nested: routes/blog/index.jsx Nested: routes/blog/2023/index.jsx

As I am re-reading Nested routes it almost sounds like it is saying a nested route is:

example 2

└── 📁blog
    └── 📁2023
        └── index.jsx
    └── index.jsx

Where each folder in the route has one or more files.

Perhaps both example 1 and example 2 both show nested routes.

Part of my confusion is that it seems so completely expected that I wonder why it is a stand-alone subject.

klequis commented 1 week ago

Another point on the same "Nested routes" section: I think this should be moved to Creating new routes as you can't create a route without knowing that.

"For a route to be rendered as a page, it must default export a component."