0

I try to understand the nested routing in react using react-router-dom. I was simply following their offical docs. Where The route /users loads the Users component, which renders any further <Route>'s conditionally on the paths :id value. Here is the codesandbox link. But whenever I goto users/:id, it render the fallback component. I was wondering where I do wrong?

1 Answer 1

1

You need to remove the exact value here:

<Route exact path="/users" component={Users} />

if you use exact only that EXACT path will be usable so /users is fine but /users/1 is not

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks @istvan Kolkert I feel shame seriously I failed to catch this. I will accept your answer after 7 min.
@falamiw Haha no worries, everyone overlooks things no shame in asking

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.