Skip to content

Commit 051fd03

Browse files
committed
Update path-matching docs
1 parent a4af7a6 commit 051fd03

File tree

1 file changed

+5
-16
lines changed

1 file changed

+5
-16
lines changed

docs/guides/path-matching.md

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,14 @@ does not match:
6060
/file/
6161
/file
6262
63-
path: /file/:name?
63+
path: /file(/:name)
6464
matches:
6565
/file/foo.js
6666
this.props.params: {name: 'foo.js'}
67-
/file/
68-
this.props.params: {}
69-
does not match:
7067
/file
71-
/file/quux/baz.js
72-
73-
path: /file/?:name?
74-
matches:
75-
/file/foo.js
76-
this.props.params: {name: 'foo.js'}
77-
/file/
78-
this.props.params: {}
79-
/file
80-
this.props.params: {}
68+
this.props.params: {name: undefined}
8169
does not match:
70+
/file/
8271
/file/quux/baz.js
8372
8473
path: /file/*
@@ -90,16 +79,16 @@ matches:
9079
/file/quux/baz.js
9180
this.props.params: {splat: 'quux/baz.js'}
9281
93-
path: /foo/*/:bar/?*?
82+
path: /foo/*/:bar(/*)
9483
matches:
9584
/foo/a.b.c/taco/def
9685
this.props.params: {bar: 'taco', splat: ['a.b.c', 'def']}
9786
/foo/a.b.c/taco
9887
this.props.params: {bar: 'taco', splat: 'a.b.c'}
9988
does not match:
89+
/foo/a.b.c/taco/
10090
/foo/a.b.c
10191
10292
path: *
10393
matches everything, but you probably want `<NotFoundRoute/>`
10494
```
105-

0 commit comments

Comments
 (0)