D
D
driver4582017-10-14 00:35:47
React
driver458, 2017-10-14 00:35:47

How to get params from Route inside nested component?

<Route path='/user/:id'>
    <App/>
</Route>

How to pull params inside App?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
driver458, 2017-10-14
@driver458

I found an example on the Internet, before that I thought that route must come with path. You can simply wrap the component in a Route and the params will be available.

<Route path='/user/:id'>
    <Route component={App}>
</Route>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question