File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,23 +13,23 @@ npm install --save react-with-params
1313
1414## Usage
1515``` typescript
16- import {withParams } from ' react-with-params'
16+ import {withParams } from ' react-with-params'
1717
18- const ShowName = withParams (' name' , {match: ' /user/:name' })(({name }) =>
19- <span >{name }< / span >
20- )
21-
22- < Route exact path = ' /user/:name' component = {ShowName } / >
18+ const ShowName = withParams (' name' , {match: ' /user/:name' })(({name }) =>
19+ <span >{name }< / span >
20+ )
21+
22+ < Route exact path = ' /user/:name' component = {ShowName } / >
2323```
2424
2525``` typescript
26- import {withParams } from ' react-with-params'
26+ import {withParams } from ' react-with-params'
27+
28+ const ShowNameAndId = withParams ([' name' , ' id' ], {match: ' /user/:name/:id' })(({name , id }) =>
29+ <span >{id } - {name }< / span >
30+ )
2731
28- const ShowNameAndId = withParams ([' name' , ' id' ], {match: ' /user/:name/:id' })(({name , id }) =>
29- <span >{id } - {name }< / span >
30- )
31-
32- < Route exact path = ' /user/:name/:id' component = {ShowNameAndId } / >
32+ < Route exact path = ' /user/:name/:id' component = {ShowNameAndId } / >
3333```
3434
3535## License
You can’t perform that action at this time.
0 commit comments