Answers for "routers in reactjs"

17

react js router

npm install react-router-dom
Posted by: Guest on November-18-2019
0

react router

import ReactDOM from "react-dom";
import { Route, BrowserRouter as Router, Switch } from "react-router-dom";
const routing = (
  <Router>
    <React.StrictMode>
      <Header />
      <Switch>
        <Route exact path="/" component={Register} />
        <Route exact path="/Login" component={Login} />
        <Route exact path="/Home" component={App} />
        <Route path="/Logout" component={Logout} />
        <Route path="/CreatePost" component={CreatePost} />
        <Route path="/CreateComment" component={CreateComment} />
        <Route path="/UserProfile" component={UserProfile} />
        <Route path="/SearchProfile" component={SearchedProfile} />
        <Route path="/follow" component={FollowDisplay} />
        <Route path="/following" component={FollowingDisplay} />
      </Switch>
      <Footer />
    </React.StrictMode>
  </Router>
);
Posted by: Guest on October-02-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language