[x] Inside of App.js there should be 6 react-router-DOM set up.
[x] First, import react router so we can use the router dom. Import should look like this: import { BrowserRouter as Router, Route, Redirect, Switch, } from 'react-router-dom
[x] Next, above class App extends React.Component add this code:
- [x] Then, inside of the ```return()``` in ```App.js``` add these routes:
- [x] Inside of the ```Pages``` folder add a folder for each route and then a javascript and SASS file inside of that folder for each route. Example: ```Folder for Whiskeys and a Whiskey.js and Whiskey.scss inside of that folder.```
UserStory
AC
When you look at the
App.js
file THEN there should be 6 routes set up.***DevNotes
npm install --save react-router-dom
import { BrowserRouter as Router, Route, Redirect, Switch, } from 'react-router-dom
class App extends React.Component
add this code:const PublicRoute2 = ({ component: Component, authed, ...rest }) => { const routeChecker = (props) => (authed === false ? <Component {...props} {...rest}/> : <Redirect to={{ pathname: '/', state: { from: props.location } }} />); return <Route {...rest} render={(props) => routeChecker(props)} />; }; const PrivateRoute2 = ({ component: Component, authed, ...rest }) => { const routeChecker = (props) => (authed === true ? <Component {...props} {...rest}/> : <Redirect to={{ pathname: '/home', state: { from: props.location } }} />); return <Route {...rest} render={(props) => routeChecker(props)} />; };