In this post I will demonstrate how to implement basic routes with ReactJS. First install following node dependencies accordingly.
webpack.config.js file and index.html file accordingly. I have already explained above these configurations in my previous ReactJS posts.
Help.js, Home.js, Student.js and StudentDetails.js files.
react-router, which will handle routing functionality. This will sync UI with URL by having components associated with routes. Child components make available in parent components by using this.props.children. Link will generate navigation links accordingly using react-router.
Next will add App.js file. In here, instead of rendering App component to the DOM, we pass Router compoenent with predefined routes. To configure index route, we can use IndexRoute.