Skip to content

Commit

Permalink
feat: upgrade react router to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
Syed-Ali-Abbas-Zaidi committed Mar 17, 2023
1 parent 145c18d commit a934307
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 160 deletions.
180 changes: 37 additions & 143 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@edx/browserslist-config": "^1.1.0",
"@edx/frontend-component-footer": "^11.6.0",
"@edx/frontend-enterprise-hotjar": "^1.2.0",
"@edx/frontend-platform": "^3.2.0",
"@edx/frontend-platform": "^3.6.0",
"@edx/paragon": "20.19.0",
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-brands-svg-icons": "^5.15.4",
Expand Down Expand Up @@ -61,7 +61,7 @@
"react-intl": "^5.20.9",
"react-pdf": "^5.5.0",
"react-redux": "^7.2.4",
"react-router-dom": "5.3.3",
"react-router-dom": "^6.0.0",
"react-share": "^4.4.0",
"react-zendesk": "^0.1.13",
"redux": "4.1.1",
Expand Down
18 changes: 11 additions & 7 deletions src/__snapshots__/index.test.jsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ exports[`app registry subscribe: APP_READY. links App to root element 1`] = `
}
}
>
<Switch>
<PageRoute
<Routes>
<Route
element={
<PageWrap>
<App />
</PageWrap>
}
path="/"
>
<App />
</PageRoute>
<Redirect
/>
<Navigate
replace={true}
to="/"
/>
</Switch>
</Routes>
</AppProvider>
</IntlProvider>
`;
14 changes: 6 additions & 8 deletions src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import 'regenerator-runtime/runtime';

import React from 'react';
import ReactDOM from 'react-dom';
import { Switch, Redirect } from 'react-router-dom';
import { Route, Navigate, Routes } from 'react-router-dom';

import {
AppProvider,
ErrorPage,
PageRoute,
PageWrap,
} from '@edx/frontend-platform/react';
import store from 'data/store';
import {
Expand All @@ -32,12 +32,10 @@ subscribe(APP_READY, () => {
ReactDOM.render(
<IntlProvider locale="en">
<AppProvider store={store}>
<Switch>
<PageRoute path="/">
<App />
</PageRoute>
<Redirect to="/" />
</Switch>
<Routes>
<Route path="/" element={<PageWrap><App /></PageWrap>} />
<Navigate to="/" replace />
</Routes>
</AppProvider>
</IntlProvider>,
document.getElementById('root'),
Expand Down

0 comments on commit a934307

Please sign in to comment.