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

useTrack hook returns unmemoized function, causing rerenders #1020

Open
syman447 opened this issue Jan 28, 2025 · 0 comments
Open

useTrack hook returns unmemoized function, causing rerenders #1020

syman447 opened this issue Jan 28, 2025 · 0 comments

Comments

@syman447
Copy link

I am having an infinite re-render issue when using the useTrack hook provided by the Next.js SDK.

I see the problem immediately - this should return a memoized useCallback, but instead returns a brand new function on every render.

My workaround is to simply use the track function returned from useDevCycleClient, which returns the same function from the DevCycle context. This is fine for me, I just wanted to point out the bug so no one else gets confused at why they're in a render loop!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant