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

Add Custom withRouteProps HOC for react-router-dom v6 migration #1836

Merged
merged 5 commits into from
Sep 30, 2023

Conversation

anshgoyalevil
Copy link
Contributor

@anshgoyalevil anshgoyalevil commented Sep 29, 2023

Which problem is this PR solving?

Description of the changes

  • On our pathway to upgrade rrd to v6.x latest, we have to use custom withRouteProps HOC since rrd v6 doesn't support withRouter.
  • With this change, we won't be able to access the history object anymore, and neither the other Route Props.
  • This PR adds the custom useHistory() hook and provider to use the history object in our custom withRouterProps HOC.

Why this PR is necessary?

  • This is a part of the upgrade process for rrd v6.
  • Since there are a lot of breaking changes other than withRouter removal in rrd v6, this PR ensure that we migrate out codebase at v5 only as recommended by the react-router-dom team in their v5 to v6 migration guide

How was this change tested?

  • Have manually checked every page. Everything is working as of now.
screen-capture.3.webm

Checklist

Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
@codecov
Copy link

codecov bot commented Sep 29, 2023

packages/jaeger-ui/src/utils/useHistory.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/utils/useHistory.tsx Outdated Show resolved Hide resolved
packages/jaeger-ui/src/utils/withRouteProps.test.js Outdated Show resolved Hide resolved
packages/jaeger-ui/src/utils/withRouteProps.tsx Outdated Show resolved Hide resolved
packages/jaeger-ui/src/utils/withRouteProps.tsx Outdated Show resolved Hide resolved
anshgoyalevil and others added 4 commits September 30, 2023 09:46
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
Signed-off-by: Ansh Goyal <anshgoyal1704@gmail.com>
@yurishkuro yurishkuro merged commit bcee38a into jaegertracing:main Sep 30, 2023
9 checks passed
@anshgoyalevil anshgoyalevil deleted the 2_rrd branch September 30, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants