Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to react-router 6 #414

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
191 changes: 33 additions & 158 deletions newdle/client/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 newdle/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"react-final-form": "^6.5.9",
"react-redux": "^8.0.2",
"react-responsive": "^9.0.0-beta.10",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-router": "^6.3.0",
"react-router-dom": "^6.3.0",
"react-scripts": "5.0.1",
"redux": "^4.2.0",
"redux-devtools-extension": "^2.13.9",
Expand Down
27 changes: 14 additions & 13 deletions newdle/client/src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import {useSelector} from 'react-redux';
import {BrowserRouter as Router, Route, Switch} from 'react-router-dom';
import {BrowserRouter as Router, Route, Routes} from 'react-router-dom';
import {i18n} from '@lingui/core';
import {I18nProvider} from '@lingui/react';
import {isLoginWindowOpen, getErrors} from '../selectors';
Expand Down Expand Up @@ -31,18 +31,19 @@ export default function App() {
<ErrorMessage key={error.id} id={error.id} error={error.error} />
))}
<section>
<Switch>
<Route exact path="/" component={HomePage} />
<Route exact path="/new" component={CreationPage} />
<Route exact path="/new/success" component={CreationSuccessPage} />
<Route exact path="/mine" component={MyNewdles} />
<Route exact path="/participating" component={NewdlesParticipating} />
<Route exact path="/newdle/:code/summary" component={SummaryPage} />
<Route path="/newdle/:code/edit" component={EditPage} />
<Route path="/newdle/:code/clone" component={ClonePage} />
<Route exact path="/newdle/:code/:partcode?" component={AnswerPage} />
<Route render={() => <div>This page does not exist</div>} />
</Switch>
<Routes>
<Route exact path="/" element={<HomePage />} />
<Route exact path="/new" element={<CreationPage />} />
<Route exact path="/new/success" element={<CreationSuccessPage />} />
<Route exact path="/mine" element={<MyNewdles />} />
<Route exact path="/participating" element={<NewdlesParticipating />} />
<Route exact path="/newdle/:code/summary" element={<SummaryPage />} />
<Route path="/newdle/:code/edit/*" element={<EditPage />} />
<Route path="/newdle/:code/clone" element={<ClonePage />} />
<Route exact path="/newdle/:code" element={<AnswerPage />} />
<Route exact path="/newdle/:code/:partcode" element={<AnswerPage />} />
<Route path="*" element={<div>This page does not exist</div>} />
</Routes>
</section>
<LoginPrompt />
{loggingIn && <LoggingIn />}
Expand Down
Loading