File tree 1 file changed +12
-12
lines changed
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -13,23 +13,23 @@ npm install --save react-with-params
13
13
14
14
## Usage
15
15
``` typescript
16
- import {withParams } from ' react-with-params'
16
+ import {withParams } from ' react-with-params'
17
17
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 } / >
23
23
```
24
24
25
25
``` 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
+ )
27
31
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 } / >
33
33
```
34
34
35
35
## License
You can’t perform that action at this time.
0 commit comments