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

Props can't be defined on Route anymore?

Hello! Following the video I tried passing down props by defining the "data" prop on the Route: <Route path={`${match.path}/html` } render={CourseContainer} data={HTMLCourses} />

But it resulted in that props.data is undefined.

I remembered reading something about a change where you only could add props by making a render function and add the props on the component inside the route.

So this worked for me: <Route path={`${match.path}/html` } render= { () => ( <CourseContainer data={HTMLCourses} /> )} />

I read about that thing here: https://github.com/ReactTraining/react-router/issues/4627