Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
changes to deal with deprecation of <Switch> element
Browse files Browse the repository at this point in the history
  • Loading branch information
rashley-iqt committed Nov 8, 2021
1 parent b5f20e0 commit 9863431
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions ui/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { withCookies, Cookies } from 'react-cookie';
import { instanceOf } from 'prop-types';
import { v4 as uuidv4 } from 'uuid';

import { BrowserRouter, Route, Switch } from 'react-router-dom';
import { BrowserRouter, Route, Routes } from 'react-router-dom';

import { setSessionId, getFileId, setFileId } from 'domain/data';

Expand All @@ -13,6 +13,8 @@ import Navbar from 'components/Navbar';
import Home from 'components/home/Home';
import Dossier from 'components/dossier/Dossier';
import DeviceTable from 'components/devices/DeviceTable';
import Error from 'components/error/Error';


const COOKIE_NAME = 'sessionID'

Expand Down Expand Up @@ -54,18 +56,12 @@ class App extends React.Component {
<BrowserRouter>
<div>
<Navbar selectedFileId={this.props.fileId} setFileId={this.props.setFileId}/>
<Switch>
<Route exact path="/">
<Home sessionId={this.state.sessionId} clearResults={this.clearResults} fileId={this.props.fileId} setFileId={this.setFileId}/>
</Route>
<Route exact path="/dossier">
<Dossier sessionId={this.state.sessionId} fileId={this.props.fileId}/>
</Route>
<Route path="/devices/:typeFilter">
<DeviceTable sessionId={this.state.sessionId} fileId={this.props.fileId}/>
</Route>
<Route component={Error}/>
</Switch>
<Routes>
<Route exact path="/" element={<Home sessionId={this.state.sessionId} clearResults={this.clearResults} fileId={this.props.fileId} setFileId={this.setFileId}/>} />
<Route path="/dossier" element={<Dossier sessionId={this.state.sessionId} fileId={this.props.fileId}/>} />
<Route path="/devices/:typeFilter" element={<DeviceTable sessionId={this.state.sessionId} fileId={this.props.fileId}/>} />
<Route path="*" element={<Error/>}/>
</Routes>
</div>
</BrowserRouter>
</>
Expand Down

0 comments on commit 9863431

Please sign in to comment.