I have the following route config. dynamicPost: { path: '/posts/:postId', method: 'get', page: 'Post', title: 'Post', handler: SinglePost } How do i get post id in my Component ?
Asked
Active
Viewed 52 times
0
-
you can get it in the component using props.currentRoute.params. – Sourav Mukherjee Oct 09 '17 at 00:25
1 Answers
0
Use this:
props.currentRoute.params.postId

Robert Columbia
- 6,313
- 15
- 32
- 40

Sourav Mukherjee
- 299
- 7
- 13