Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript React Router 4 Basics Going Further with Routing Using URL Parameters

blake guyan
blake guyan
8,297 Points

URL parameters not working, has REACT changed?

So I am doing the REACT course and this lesson is set up so that if there is a subURL to teachers that it will populate the page using the "featured.js" jsx data. however dispite the fact that if i mess up the syntax on "featured.js" i get an error it is somehow still showing the teachers page.. i am most confused...

2 Answers

Thomas Dimnet
.a{fill-rule:evenodd;}techdegree seal-36
Thomas Dimnet
Python Development Techdegree Graduate 43,629 Points

Hi Blake,

do you have maybe a piece of code you can show in order to understand what's going wrong with your code? I've just finished the course and I did not encounter any errors.


Jacob Silverman
Jacob Silverman
Full Stack JavaScript Techdegree Student 14,357 Points

Hi Blake, you may have made the same mistake as me.

Initially I used 'exactly' instead of 'exact' prop. This is the correct two lines:

<Route exact path="/teachers" component={Teachers} />
<Route path="/teachers" component={Featured} />