React Router: Let’s unwind another mystery in React
Open the application in any code editor and If you will see inside the public folder, there will a file named as index.html.
A crucial point to notice here is that we have only one HTML file which implies that currently, we have a single-page app.
Here we are reusing this single HTML page for the rendering of multiple components using routing.
To start the dive first install react router in your application using below command.
npm install react-router-dom
weird huh ?? why the command has react-router-dom if I have to install something called as react-router because react router is the core library which includes everything related to routing or navigation.
And here we only need react-router-dom to understand and manage the routing in our application.
react-router-native will be required for handling the routing on native-mobile applications.
react-router-redux is required for binding of your react-application with the redux library i.e when you want to manage your routing using redux. Ideally, it is avoided.
Author Signature :
my name is sasi kiran
CronJ is a leading React JS Development Company based in the USA, Bangalore, India, New York, UK developing and offering the best platform for ReactJS development services. We have a professional and ..