Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

switch is not exported from react-router-dom

import React from "react";
    import "./App.css";
    import NavBar from "./components/navbar.js";
    import Footer from "./components/footer.js";
    import Home from "./components/pages/homepage/home.js";
    import { BrowserRouter as Router, Switch, Route, Link } from "react-router-dom";
    
    function App() {
      return (
        <Router>
          <div className="app-container">
            <NavBar />
            <Switch>
              <Route path="/home" component={Home} />
            </Switch>
            <Footer />
          </div>
        </Router>
      );
    }
    
    export default App;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #switch #exported
ADD COMMENT
Topic
Name
5+8 =