-
Notifications
You must be signed in to change notification settings - Fork 197
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
Fix deprecated route syntax generated by form system #35469
Comments
FYI I've created a React Router Guidelines page which may also be useful. |
First step is to upgrade to React Router 5. Joint effort between FLT and Front End Tools team and any other relevant team(s). |
The Forms Library Team is no longer working on a React Router V3 --> V5 upgrade. Given that V3 and V5 apps currently co-exist on Vets Website, and that any form apps on Router V3 will need a rewrite to migrate to the new VA Forms System Core (VAFSC) anyway, providing a migration path from React Router V3 to V5 is a step that doesn't provide a good return on time invested for the Forms Library Team. For details on this decision, please see these Confluence pages: The Forms Library Team will instead be working on a React Router V5 --> V6 upgrade, see this ticket for details. Other tickets that reference React Router V3 -V5 upgrades: |
Katy will talk to Chris A. about closing this out. |
User story(ies)
As a VSP engineer, I want to upgrade React Router to enable additional features for VFS developers, and to keep the router up to date with the rest of React.
This upgrade is currently blocked by deprecated route syntax generated by the form system.
Additional details/notes/links
Apps use the form system to generate child routes based on the formConfig like this:
The generated child routes are returned from
createRoutesWithSaveInProgress()
as a JS object. The object is compatible withreact-router
version 3 which we are currently using. However in newer versions of react-router, routes must be defined using router components instead. In order to upgrade react-router, the form system must first return routes with the new format.In addition, it could be useful to make a small change in
RoutedSavableApp
. Currently it's used like this:The currentLocation is passed into RoutedSavableApp by the parent component. But with react-router v5, the
useLocation()
hook is provided as a method to retrieve the location anywhere in the component hierarchy. So it should no longer be necessary for the parent to pass in the location as a prop.Additional documentation:
Acceptance criteria
Point(s) of contact
What type of issue is this?
How to configure this issue
The text was updated successfully, but these errors were encountered: