Skip to content

Commit 87f8249

Browse files
committed
Update docs to show splat & regex location paths.
1 parent 6196d5a commit 87f8249

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Diff for: README.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ component's `render()` method:
99
<Locations>
1010
<Location path="/" handler={MainPage} />
1111
<Location path="/users/:username" handler={UserPage} />
12+
<Location path="/search/*" handler={SearchPage} />
13+
<Location path=/\/product\/([0-9]*)/ handler={ProductPage} />
1214
</Locations>
1315

1416
Alternatively, if you don't prefer JSX:
1517

1618
Locations(null,
1719
Location({path: "/", handler: MainPage}),
1820
Location({path: "/users/:username", handler: UserPage}))
21+
Location({path: "/search/*", handler: SearchPage}))
22+
Location({path: /\/product\/([0-9]*)/, handler: ProductPage}))
1923

2024
Having routes defined as a part of your component hierarchy allows to
2125
dynamically reconfigure routing based on your application state. For example you

Diff for: docs/index.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ component's `render()` method:
99
<Locations>
1010
<Location path="/" handler={MainPage} />
1111
<Location path="/users/:username" handler={UserPage} />
12+
<Location path="/search/*" handler={SearchPage} />
13+
<Location path=/\/product\/([0-9]*)/ handler={ProductPage} />
1214
</Locations>
1315

1416
Alternatively, if you don't prefer JSX:
1517

1618
Locations(null,
1719
Location({path: "/", handler: MainPage}),
1820
Location({path: "/users/:username", handler: UserPage}))
21+
Location({path: "/search/*", handler: SearchPage}))
22+
Location({path: /\/product\/([0-9]*)/, handler: ProductPage}))
1923

2024
Having routes defined as a part of your component hierarchy allows to
2125
dynamically reconfigure routing based on your application state. For example you

0 commit comments

Comments
 (0)