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

feat: add previous page to navigatePage [OTE-768] #1170

Merged
merged 1 commit into from
Oct 18, 2024

Conversation

yogurtandjam
Copy link
Contributor

Uses a ref to track the previous location pathname outside of the react lifecycle. if people are spooked by this i'm happy to use another approach but it feels pretty stable to me

@yogurtandjam yogurtandjam requested a review from a team as a code owner October 17, 2024 21:28
Copy link

linear bot commented Oct 17, 2024

Copy link

vercel bot commented Oct 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
v4-staging ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 9:31pm
v4-testnet ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2024 9:31pm

const previousPath = previousPathRef.current;
track(AnalyticsEvents.NavigatePage({ path: location.pathname, previousPath }));
previousPathRef.current = location.pathname;
}
}, [location]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be location.pathname ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm yeah that makes sense. 🤔 can fix later though so we don't have to re-approve this PR

@yogurtandjam yogurtandjam merged commit 8052743 into main Oct 18, 2024
9 checks passed
@yogurtandjam yogurtandjam deleted the jerms/OTE-768_previous-page-navigatePage branch October 18, 2024 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants