Skip to content

Commit

Permalink
Update path-matching docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mjackson committed Apr 21, 2015
1 parent a4af7a6 commit 051fd03
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions docs/guides/path-matching.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,14 @@ does not match:
/file/
/file
path: /file/:name?
path: /file(/:name)
matches:
/file/foo.js
this.props.params: {name: 'foo.js'}
/file/
this.props.params: {}
does not match:
/file
/file/quux/baz.js
path: /file/?:name?
matches:
/file/foo.js
this.props.params: {name: 'foo.js'}
/file/
this.props.params: {}
/file
this.props.params: {}
this.props.params: {name: undefined}
does not match:
/file/
/file/quux/baz.js
path: /file/*
Expand All @@ -90,16 +79,16 @@ matches:
/file/quux/baz.js
this.props.params: {splat: 'quux/baz.js'}
path: /foo/*/:bar/?*?
path: /foo/*/:bar(/*)
matches:
/foo/a.b.c/taco/def
this.props.params: {bar: 'taco', splat: ['a.b.c', 'def']}
/foo/a.b.c/taco
this.props.params: {bar: 'taco', splat: 'a.b.c'}
does not match:
/foo/a.b.c/taco/
/foo/a.b.c
path: *
matches everything, but you probably want `<NotFoundRoute/>`
```

0 comments on commit 051fd03

Please sign in to comment.