Create a React component in JavaScript. Create a component file called App in the src directory.
Create three parts. To begin, create a components directory and add the Home. js component to it.
In the App. js file, register the routes.
A Route> component will be used to identify each route. Two properties will be passed to the Route> component: path and component. It will return the component supplied if a path matches the route given to the Route> component.
Install react-router-dom in our application's root directory. Make the components we'll be rendering. From the react-router-dom API, import the BrowserRouter, Route, and Switch components. Wrap the App component with the BrowserRouter to enable routing functionality for the App.
React Router's most significant component is the Route component. If the current location fits the route's path, it displays some UI. A Route> component should ideally have a path prop, which is rendered if the path name matches the current location.
React Router isn't required in this situation. React Router, on the other hand, has a lot of navigational components that you can use to assemble your application declaratively, which may be quite beneficial for larger and more sophisticated navigational requirements in React apps. It's also excellent for React Native apps.
Learner's Ratings
4.6
Overall Rating
79%
12%
6%
1%
2%
Reviews
M
Mohanlal Khhurana
5
Very helpful course in learning ReactJS
A
Abdul Sattar
5
Please update this course some topics are deprecated.
M
Muhammad Usman
5
Amazing course
Y
Yash Patel
5
Superb Course Thanks for sharing
K
Karan
5
Learnvern All Courses are Great Thanks To Provide Best Content.
Me Aapka Life Time Tak Abhari Rahunga
Thanks
A
Ankush Mittal
4
resources me jake download ki file but file open krne pr usme kuch hi aahra
S
satyam pandey
4
resourse link is not working
N
Niyyer Abbas
5
good
T
Tanay Lohani
5
very good course. Content Delivery of Trainer is very very awesome. I suggest everyone who want to learn react I prefer learn vern
M
Manish Kumar
5
Thanks LearnVern, If I get job than I will donate my 1st salary to LearnVern
Share a personalized message with your friends.