Install react-router-dom using the following command
npm install --save react-router-dom
create a new file (MainRouter) in your project directory
import { BrowserRouter, Route, Link } from "react-router-dom"; //import the package
import SignIn from "../SignIn" //import your signIn page
import SignUp from "../SignUp" //import your signUp page
function MainRouter(){
return(
<BrowserRouter>
<div className="container">
<Switch>
<Route path="/signIn" component={SignIn} />
<Route path="/signUp" component={SignUP} />
</Switch>
</div>
</BrowserRouter>
)
}
export default MainRouter
Why you need this
react-router-dom package allows you to dynamically navigate the pages in your browser(client side) without refreshing the page,it a nice way to handle navigation in single page application