RevereCRE / relay-nextjs

⚡️ Relay integration for Next.js apps
https://reverecre.github.io/relay-nextjs/
MIT License
251 stars 30 forks source link

Page component got mount again when using array in query variables #84

Closed vip30 closed 1 year ago

vip30 commented 1 year ago

https://github.com/RevereCRE/relay-nextjs/blob/d9ad8aafba17ec8bc61f4bc054e892b6bfbe9b1f/relay-nextjs/src/wired/component.tsx#L88-L92

Seems it's because relay-nextjs is using shallow comparison so if we're using array in the qurey variables, the useHaveQueryVariablesChanges will return true by each of the re-render

Is that possible to use deep compare?

rrdelaney commented 1 year ago

Thank you for bringing this up! This should be fix with the 2.0 release later today or tomorrow as we now use a deep-equal comparison. Will update here upon release!

rrdelaney commented 1 year ago

v2.0.0 has been released! This should no longer be an issue.