Skip to content

Commit a80161e

Browse files
author
crzypatchwork
committed
browser router test
1 parent c0c47f3 commit a80161e

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"web-encoding": "1.1.5"
5252
},
5353
"scripts": {
54+
"postinstall": "npx patch-package",
5455
"start": "react-scripts start",
5556
"build": "react-scripts build",
5657
"test": "react-scripts test",

src/App.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
import React, { useEffect, useState } from 'react'
2-
import { Switch, Route } from 'react-router-dom'
2+
import { Switch, Route, BrowserRouter, HashRouter } from 'react-router-dom'
33
import HicetnuncContextProvider from './context/HicetnuncContext'
44
import { getInitialData } from './data/api'
55
import { Header } from './components/header'
66
import { Loading as Preloading } from './components/loading'
77
import { FeedbackComponent } from './components/feedback'
88
import { routes } from './routes'
9+
import { Galleries } from './pages/galleries'
10+
import { Config } from './pages/config'
11+
import { Search } from './pages/search'
12+
import { Latest, Hdao, Random, Featured } from './pages/feeds'
13+
import Display from './pages/display'
14+
import { About } from './pages/about'
15+
import { FAQ } from './pages/faq'
16+
import { CollabDisplay, Collaborate } from './pages/collaborate'
17+
import { ObjktDisplay } from './pages/objkt-display'
18+
import { GalleryDetail } from './pages/gallery-detail'
919

1020
const App = () => {
1121
const [loading, setLoading] = useState(true)
@@ -25,11 +35,13 @@ const App = () => {
2535
<HicetnuncContextProvider>
2636
<Header />
2737
<FeedbackComponent />
28-
<Switch>
29-
{routes.map(({ exact, path, component: Comp }) => (
30-
<Route path={path} exact={exact} key={path} component={Comp} />
31-
))}
32-
</Switch>
38+
<BrowserRouter>
39+
<Switch>
40+
{routes.map(({ exact, path, component: Comp }) => (
41+
<Route path={path} exact={exact} key={path} component={Comp} />
42+
))}
43+
</Switch>
44+
</BrowserRouter>
3345
</HicetnuncContextProvider>
3446
)
3547
}

0 commit comments

Comments
 (0)