-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make
usePageContext
return the correct path no matter where its cal…
…led (#21433) ## Summary & Motivation To log page load we need to inform datadog when a new view starts. To do this we currently rely on `usePageContext` to change when the path changes. Currently it doesn't do that because `usePageContext` relies on `useRouteMatch` from react-router-dom which finds the path from the closest parent `Route`. The issue is that we're calling `usePageContext` from a provider that is very high up in the tree, so `useRouteMatch` can't access the context of the `<Route>` currently being rendered. Instead of using `useRouteMatch` lets store the path in global state when `useTrackPageView` is called and have `usePageContext` rely on that global state. Cloud requires this change to dedupe recoil: dagster-io/internal#9471 ## How I Tested These Changes 👀 , play around with the app make sure nothing is broken
- Loading branch information
Showing
8 changed files
with
159 additions
and
102 deletions.
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
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.
8247864
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.
Deploy preview for dagit-core-storybook ready!
✅ Preview
https://dagit-core-storybook-byn3di06i-elementl.vercel.app
Built with commit 8247864.
This pull request is being automatically deployed with vercel-action