Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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>
);
Source by reacttraining.com #
 
PREVIOUS NEXT
Tagged: #react #router
ADD COMMENT
Topic
Name
4+6 =