-
Notifications
You must be signed in to change notification settings - Fork 178
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
feat(components, app, labware-library): migrate to react-router-dom v6.24.1 #15699
Merged
Merged
Changes from 10 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
68b0e23
remove react-router-dom from components directory
jerader 586a1ae
update labware-library react-router-dom
jerader 307da46
fix app components but not tests
jerader ba1bdbf
feat(components, app, labware-library): migrate to react-router-dom v…
jerader 3928521
fix prettier
jerader 6349e40
fix tests
jerader c2d1f58
address comments
jerader 8623e14
import type not typeof
jerader a054df0
fix final unit tests
jerader 6753cbb
change type to NavigateFunction
jerader ff1e62c
fix navigate path for odd
jerader 9ff20a5
Merge branch 'edge' into chore_update-react-router-dom
jerader File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
@@ -1,6 +1,6 @@ | ||||||||||
import * as React from 'react' | ||||||||||
import { useDispatch, useSelector } from 'react-redux' | ||||||||||
import { Switch, Route, Redirect } from 'react-router-dom' | ||||||||||
import { Routes, Route, Navigate } from 'react-router-dom' | ||||||||||
import { css } from 'styled-components' | ||||||||||
import { ErrorBoundary } from 'react-error-boundary' | ||||||||||
|
||||||||||
|
@@ -252,23 +252,31 @@ export function OnDeviceDisplayAppRoutes(): JSX.Element { | |||||||||
` | ||||||||||
|
||||||||||
return ( | ||||||||||
<Switch> | ||||||||||
<Routes> | ||||||||||
{ON_DEVICE_DISPLAY_PATHS.map(path => ( | ||||||||||
<Route key={path} exact path={path}> | ||||||||||
<Box css={TOUCH_SCREEN_STYLE} ref={scrollRef}> | ||||||||||
<ModalPortalRoot /> | ||||||||||
{getPathComponent(path)} | ||||||||||
</Box> | ||||||||||
</Route> | ||||||||||
<Route | ||||||||||
key={path} | ||||||||||
path={path} | ||||||||||
element={ | ||||||||||
<Box css={TOUCH_SCREEN_STYLE} ref={scrollRef}> | ||||||||||
<ModalPortalRoot /> | ||||||||||
{getPathComponent(path)} | ||||||||||
</Box> | ||||||||||
} | ||||||||||
/> | ||||||||||
))} | ||||||||||
{targetPath != null && <Redirect exact from="/" to={targetPath} />} | ||||||||||
</Switch> | ||||||||||
{targetPath != null && ( | ||||||||||
<Route path="/" element={<Navigate to={targetPath} />} /> | ||||||||||
)} | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://stackoverflow.com/questions/69868956/how-can-i-redirect-in-react-router-v6
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you so much koji! |
||||||||||
</Routes> | ||||||||||
) | ||||||||||
} | ||||||||||
|
||||||||||
function TopLevelRedirects(): JSX.Element | null { | ||||||||||
const currentRunRoute = useCurrentRunRoute() | ||||||||||
return currentRunRoute != null ? <Redirect to={currentRunRoute} /> : null | ||||||||||
return currentRunRoute != null ? ( | ||||||||||
<Route element={<Navigate to={currentRunRoute} />} /> | ||||||||||
) : null | ||||||||||
} | ||||||||||
|
||||||||||
function ProtocolReceiptToasts(): null { | ||||||||||
|
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
not introducing v6.25.0/v6.25.1 because too new?
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.
oh wait i think v6.25.0 came out just yesterday, that is why i did not use it lol. Shouldn't we stick with 6.24.1 to match PD though? hmm. @shlokamin thoughts?
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.
6.25.0 2days ago and 6.25.1 yesterday.
https://github.com/remix-run/react-router/releases
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.
doesn't matter to me as long as all of our frontend projects share the same version, so we can either update PD or keep these at 6.24.1