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!
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
Moses Isang7,674 Points
I don't understand how we lost the Redirect when clicking on on the main Courses link in the header. My understanding is that click is handled by the Header component which has a Route component that matches /courses and then loads our Courses component which has a Redirect to /courses/html. I don't understand why we need a Route component to /courses in the Courses component file. Isn't that Courses link handled by the Header component that has a Route to /courses?
Adam McGrade26,333 Points
My understanding is that once the route hits "/courses", the routing is controlled by the Courses component.
To avoid this behaviour, we created a Route component with the "exact" property set to "/courses" that returns the Redirect component to ensure that the redirect only occurs on a route that is an exact match for "/courses".