Member-only story
React-Router 5 and Private Routes
React-Router
React router allows you to route around your react application. Even you can create your own components as different pages on client side or you can use router for server side rendering options.
React Router Github it has 36,564 stars right now.
That is probably one of the packages you will install to your react application if you want to use multiple pages and i can say that is the most popular one.
Versions
"react": "16.8.6",
"react-router": "^5.0.1",
"react-router-dom": "^5.0.1",
If you are already created your application with React and just want to learn how to use react-router please skip to the part Installing React-Router.
Lets Start with creating react app
Before start that great tool you need to install Nodejs to your computer.
You’ll need to have Node 8.10.0 or later on your local development machine.
Preperation is over. Now lets create your project in a seconds! We are creating an react application named my-app with running these codes below.
You can use npx, npm or yarn as you want.