-
Notifications
You must be signed in to change notification settings - Fork 253
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
ui: migrate from react-router to wouter #2415
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m17ch
approved these changes
May 31, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
KatieMSB
approved these changes
May 31, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
Replaces the use of
react-router-dom
withwouter
Which issue(s) this PR fixes:
This work is part of the CI stability work and resolves lost-event issues by switching libraries.
See: remix-run/react-router#7460
and: remix-run/react-router#8809
Describe any introduced user-facing changes:
/profile
pages and links continue to function, but redirect to/user/<id>
. This wasn't strictly necessary but was part of the routing cleanup. See more below.Admin:
followed by the page name./services/:serviceID/alerts/:alertID
Additional Info:
inithttp.go
for the backend, all routes are now registered in theAppRoutes.tsx
file instead of scattered around the application.useParams
)Redirect
replacesNavigate
(same behavior)const [, navigate] = useLocation()
replacesconst navigate = useNavigate()
(same behavior)*Router
components have been removed, the exception being theWizardRouter
which isn't a routerconst urlKey = useURLKey()
replacesconst { key: urlKey } = useLocation()
SideBarDrawerList
andNavSubMenu
have been replaced with a rewritten component calledNavBar
filled with standardizedNavBarLink
andNavBarSubLink
components. Styling has been left unchanged.ToolbarAction
is now fed a list of routes directly fromAppRoutes.tsx
so it no longer needs to be kept in sync manually.ToolbarTitle
has been reworked to fix some edge cases, like updating the document title at the right time and resolving some race conditions. It also has been generalized slightly to remove some special cases.refetchAll
has been added to the window to be called from tests when necessary