Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react router

import "./App.css";
import SignIn from "./SignIn";
import { BrowserRouter as Router, Route, Routes } from "react-router-dom";
import PrimarySearchAppBar from "./Header";
import SignUp from "./SignUp";
function App() {
  return (
    <Router>
      <PrimarySearchAppBar />
      <Routes>
        {["/", "/home"].map((path) => (
          <Route exact path={path} element={<Home />} />
        ))}
        <Route path="/signin" exact element={<SignIn />} />
        <Route path="/signup" exact element={<SignUp />} />
        <Route exact path="*" element={<ComingSoon />} />
      </Routes>
    </Router>
  );
}

export default App;
Source by medium.com #
 
PREVIOUS NEXT
Tagged: #react #router
ADD COMMENT
Topic
Name
7+1 =