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 Navigating Routes Programmatically

Alan McClenaghan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alan McClenaghan
Full Stack JavaScript Techdegree Graduate 56,501 Points

Add React Router 4 Basic project to online portfolio

Hi. I would like to add the course directory app to my portfolio. However as the files are not based at the homepage of my website, the Page Not Found component displays instead of the Home component. When the links in the Header are clicked, the components will then display correctly.

My app is located at http://alanmcclenaghan.com/react/course-directory/

Can anyone tell me how I can get the Home component to render at this location with the app working as expected when the links are clicked?

My files can be at https://github.com/AlanMcClenaghan/React-Router-4

I realize this question is old now but I honestly have no idea why you would add the example project for a Treehouse course to your portfolio. You didn't really build it. You were walked through the process for learning purposes. A project is only portfolio-worthy if you actually built it yourself, without an instructor walking you through it. Otherwise you cannot tell an employer that it is genuinely your work.

2 Answers

Alan McClenaghan
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Alan McClenaghan
Full Stack JavaScript Techdegree Graduate 56,501 Points

I discovered that my hosting service allows me to create hosting packages without having an actual web domain to place them, which can then be viewed at a temporary web address which I can link to from my portfolio site.

http://react-router-4-basics-com.sites.stackstaging.com/

The React Router app is now at the home index of the temporary web address above.

It would still be interesting to discover if it is possible to place a React Router app as a subfolder of another website.

Cooper Runstein
Cooper Runstein
11,850 Points

Hmmm, I'm assuming you're not using React Router for your website, just this project you want to add to it?