Skip to content

Commit a8dfef0

Browse files
authored
Update Index File Naming Convention (#768)
1 parent d6e4b65 commit a8dfef0

File tree

1 file changed

+4
-2
lines changed
  • src/routes/solid-start/building-your-application

1 file changed

+4
-2
lines changed

src/routes/solid-start/building-your-application/routing.mdx

+4-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ export default function Index() {
7777
By default, the component that is rendered for a route comes from the default export of the `index.tsx` file in each folder.
7878
However, this can make it difficult to find the correct `index.tsx` file when searching, since there will be multiple files with that name.
7979

80-
To avoid this, you can rename the `index.tsx` file to the name of the folder it is in and it will be rendered as the default export for that route:
80+
To avoid this, you can rename the `index.tsx` file to the name of the folder it is in, enclosed in parenthesis.
81+
82+
This way, it will be treated as the default export for that route:
8183

8284
```jsx {2, 4, 6}
8385
|-- routes/ // example.com
@@ -88,7 +90,7 @@ To avoid this, you can rename the `index.tsx` file to the name of the folder it
8890
|-- job-1.tsx // example.com/work/job-1
8991
|-- job-2.tsx
9092
|-- socials/
91-
|-- socials.tsx // example.com/socials
93+
|-- (socials).tsx // example.com/socials
9294
```
9395

9496
#### Escaping nested routes

0 commit comments

Comments
 (0)