Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

useEffect's router.push triggers a double-render #275

Closed
4 tasks
kelvinkoon opened this issue Jul 18, 2023 · 0 comments
Closed
4 tasks

useEffect's router.push triggers a double-render #275

kelvinkoon opened this issue Jul 18, 2023 · 0 comments
Labels
frontend we eat with our eyes first

Comments

@kelvinkoon
Copy link
Collaborator

Describe the issue
After hours of investigating, the conclusion is it may be a bug as per: vercel/next.js#18127
Initially suspected to be hydration, but router.isReady didn't help: https://nextjs.org/docs/pages/building-your-application/rendering/automatic-static-optimization#how-it-works
Only happens on hard refresh.

Acceptance Criteria

  • Find root cause of the router woes
  • Try to make it a single-render
  • If not, mitigate API call on first render somehow
  • If nothing else, implement caching layer
@kelvinkoon kelvinkoon added the frontend we eat with our eyes first label Jul 18, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
frontend we eat with our eyes first
Projects
None yet
Development

No branches or pull requests

1 participant