Closed Kikobeats closed 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
sdk-hover-react | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 9, 2023 5:47pm |
sdk-hover-vanilla | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 9, 2023 5:47pm |
sdk-react | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 9, 2023 5:47pm |
sdk-vanilla | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Dec 9, 2023 5:47pm |
I noted this warning
We excluded
toFetchData
from the hook dependencies because otherwise it creates an infinite loop. I was digging what is causing that and I noted it comes fromuseIntersectionObserver
since it returns aref
and it's being attached to aCardWrap
element, creating the loop.I think our
useIntersectionObserver
is based on this one: https://github.com/uidotdev/usehooks/blob/dfa6623fcc2dcad3b466def4e0495b3f38af962b/index.js#L512What I did for fixing this is to simply pas
ref
as argument, similar to this implementation: https://github.com/streamich/react-use/blob/e27c1930da8b94a2c570954786aa68a3dc5624be/src/useIntersection.ts#L4