Skip to content

Commit c537d55

Browse files
committed
Fix code examples
1 parent ce1b81c commit c537d55

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

doc/00 Guides/RouteMatching.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@ A route path is a string pattern that is used to match a URL (or a portion of on
1010
- `()` - specifies a portion of the URL that is optional
1111
- `*` - matches all characters up to the next character in the pattern, or the end of the URL
1212

13-
<Route path="/hello/:name"> // matches /hello/michael and /hello/ryan
14-
<Route path="/hello(/:name)"> // matches /hello, /hello/michael, and /hello/ryan
15-
<Route path="/files/*.*"> // matches /files/hello.jpg and /files/path/to/hello.jpg
13+
```
14+
<Route path="/hello/:name"> // matches /hello/michael and /hello/ryan
15+
<Route path="/hello(/:name)"> // matches /hello, /hello/michael, and /hello/ryan
16+
<Route path="/files/*.*"> // matches /files/hello.jpg and /files/path/to/hello.jpg
17+
```
1618

1719
### Nesting
1820

@@ -22,9 +24,11 @@ If a route uses a relative `path`, its `path` actually builds upon the accumulat
2224

2325
React Router traverses routes from the top of the hierarchy depth-first to find the deepest route in the hierarchy that matches the entire URL, stopping as soon as it finds one.
2426

25-
<Route path="/users"> // matches /users
26-
<Route path=":id" /> // matches /users/5
27-
<Route path="/about" /> // matches /about
28-
</Route>
27+
```
28+
<Route path="/users"> // matches /users
29+
<Route path=":id" /> // matches /users/5
30+
<Route path="/about" /> // matches /about
31+
</Route>
32+
```
2933

3034
[advanced]: AdvancedUsage.md

0 commit comments

Comments
 (0)