Advertisement
Guest User

Untitled

a guest
Nov 5th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from "react";
  2. import { Route, Switch } from "react-router-dom";
  3. import Items from "../Items/Items";
  4. import ItemDetail from "../Items/ItemDetail";
  5.  
  6. function Main(props) {
  7.   return (
  8.     <main className="container-main">
  9.       <Switch>
  10.         <Route path="/" exact render = {()=><h1>POE app Start page</h1>} />
  11.         <Route path="/items" exact component={Items} />
  12.         <Route
  13.           path="/items/:id"
  14.           exact
  15.           render={({match, location, history})=>{
  16.             return <ItemDetail/>
  17.         }} />
  18.         <Route render = {()=><h1>Page not found</h1>} />
  19.       </Switch>
  20.     </main>
  21.   );
  22. }
  23.  
  24. export default Main;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement