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

Prequel to upgrading to react-router 6 #6453

Merged
merged 6 commits into from
Jul 17, 2023
Merged

Conversation

absoludity
Copy link
Contributor

@absoludity absoludity commented Jul 12, 2023

Description of the change

Updates our routing with some preparation for the react-router upgrade. This involved:

  • Re-writing the class-based PrivateRoute component to use function/hooks,
  • Refactoring the use of Route out of the PrivateRoute component and into the routes directly, as these need to be top-level for react-router 6
  • Renaming PrivateRoute to RequireAuthentication (as it no longer generates a route).
  • Updating to simplify tests using react testing library rather than enzyme, including the renderWithProviders util (as per recommended docs)

See https://reactrouter.com/en/main/upgrading/v5

Benefits

One step closer to updating to react-router 6.
Starts transition from enzyme to react testinglibrary.

Applicable issues

@netlify
Copy link

netlify bot commented Jul 12, 2023

Deploy Preview for kubeapps-dev canceled.

Name Link
🔨 Latest commit ee4c056
🔍 Latest deploy log https://app.netlify.com/sites/kubeapps-dev/deploys/64b4c819523f6600082dfb89

Signed-off-by: Michael Nelson <minelson@vmware.com>
… concepts.

Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
Signed-off-by: Michael Nelson <minelson@vmware.com>
@absoludity absoludity merged commit 8c98273 into main Jul 17, 2023
@absoludity absoludity deleted the react-router-upgrade-1 branch July 17, 2023 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants