upgraded packages in package.json file and created useWithRouter hook

This commit is contained in:
andres alcocer
2022-11-23 15:03:15 -05:00
parent c67f6359ff
commit 187e405505
5 changed files with 8234 additions and 8460 deletions

View File

@@ -1,5 +1,5 @@
import React from 'react'
import { BrowserRouter, Redirect, Route, Switch } from 'react-router-dom'
import { BrowserRouter, Redirect, Route, Routes } from 'react-router-dom'
import Footer from './components/Footer'
import Navbar from './components/Navbar'
import Home from './pages/Home'
@@ -9,12 +9,12 @@ import Search from './pages/Search'
const AppRouter = () => (
<BrowserRouter>
<Navbar />
<Switch>
<Route path='/' exact render={() => <Redirect to='/browse' />} />
<Routes>
<Route path='/' exact render={() => <Navigate to='/browse' />} />
<Route path='/browse' component={Home} />
<Route path='/search' component={Search} />
<Route component={NotFound} />
</Switch>
</Routes>
<Footer />
</BrowserRouter>
)