File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,17 @@ component's `render()` method:
9
9
<Locations>
10
10
<Location path="/" handler={MainPage} />
11
11
<Location path="/users/:username" handler={UserPage} />
12
+ <Location path="/search/*" handler={SearchPage} />
13
+ <Location path=/\/product\/([0-9]*)/ handler={ProductPage} />
12
14
</Locations>
13
15
14
16
Alternatively, if you don't prefer JSX:
15
17
16
18
Locations(null,
17
19
Location({path: "/", handler: MainPage}),
18
20
Location({path: "/users/:username", handler: UserPage}))
21
+ Location({path: "/search/*", handler: SearchPage}))
22
+ Location({path: /\/product\/([0-9]*)/, handler: ProductPage}))
19
23
20
24
Having routes defined as a part of your component hierarchy allows to
21
25
dynamically reconfigure routing based on your application state. For example you
Original file line number Diff line number Diff line change @@ -9,13 +9,17 @@ component's `render()` method:
9
9
<Locations>
10
10
<Location path="/" handler={MainPage} />
11
11
<Location path="/users/:username" handler={UserPage} />
12
+ <Location path="/search/*" handler={SearchPage} />
13
+ <Location path=/\/product\/([0-9]*)/ handler={ProductPage} />
12
14
</Locations>
13
15
14
16
Alternatively, if you don't prefer JSX:
15
17
16
18
Locations(null,
17
19
Location({path: "/", handler: MainPage}),
18
20
Location({path: "/users/:username", handler: UserPage}))
21
+ Location({path: "/search/*", handler: SearchPage}))
22
+ Location({path: /\/product\/([0-9]*)/, handler: ProductPage}))
19
23
20
24
Having routes defined as a part of your component hierarchy allows to
21
25
dynamically reconfigure routing based on your application state. For example you
You can’t perform that action at this time.
0 commit comments