Skip to main content

Posts

Showing posts with the label npm

React Router | NPM React Router Dom

React Router is a collection of navigational components that compose declaratively with your application. React router gives us three components [ BrowserRouter , Route , Link ] which helps us to implement the routing to the apps. Route History : Every router creates history object to keep track of the current location of the page. There are two types of router object: 1.       BrowserRouter 2.       HashRouter If we want to handle the dynamic request then use BrowserRouter and if we want to serve the static request then use HashRouter. Is React Router Static or Dynamic? Before the react router v4 it is static after v4 it is Dynamic. As an Example 1 , First we need to create a react app and the need to install “react router dom” npm command. Install – npm   i   react - router - dom Currently, in our app, there is only a single App component. This component created by default wh...