Skip to content

Commit

Permalink
use Compat*
Browse files Browse the repository at this point in the history
  • Loading branch information
keyasuda committed Dec 30, 2024
1 parent 504f680 commit 2e8d889
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/component/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { useEffect, useState } from 'react'
import { Provider } from 'react-redux'
import { Router, Route, Switch } from 'react-router-dom'
import { CompatRouter, CompatRoute } from 'react-router-dom-v5-compat' // ここでCompatRouterをインポート

import { store, history } from '../state/store'
import AppMenu from './app/AppMenu'
Expand All @@ -27,17 +28,25 @@ const App: React.FC = () => {
<SignInButton styles={{ marginTop: 'calc(50vh - 29px)' }}>
<Provider store={store}>
<Router history={history}>
<Switch>
<Route path="/app/:fileId/print" component={PrintQueue} />
<Route path="/app/:fileId/storages/:itemId" component={Storage} />
<Route path="/app/:fileId/storages" component={Storages} />
<Route
path="/app/:fileId/belongings/:itemId"
component={Belonging}
/>
<Route path="/app/:fileId/belongings" component={Belongings} />
<Route path="/app/:fileId" component={AppMenu} />
</Switch>
<CompatRouter>
<Switch>
<CompatRoute path="/app/:fileId/print" component={PrintQueue} />
<CompatRoute
path="/app/:fileId/storages/:itemId"
component={Storage}
/>
<CompatRoute path="/app/:fileId/storages" component={Storages} />
<CompatRoute
path="/app/:fileId/belongings/:itemId"
component={Belonging}
/>
<CompatRoute
path="/app/:fileId/belongings"
component={Belongings}
/>
<CompatRoute path="/app/:fileId" component={AppMenu} />
</Switch>
</CompatRouter>
</Router>
</Provider>
</SignInButton>
Expand Down

0 comments on commit 2e8d889

Please sign in to comment.