You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the parentRef is initially null, so observer.observe(parentRef.current); is never executed, even if parentRef is set to the element after initial render.
The text was updated successfully, but these errors were encountered:
Hi @Ti-tanium could you provide a codesandbox reproducing the issue you're seeing? The useParentSize hook should be working but a lot depends on how it is used.
Hi, I tried using the
useParentSize
hook. The width and height are always 0 when I resize the parent container.After looking at the source code, I believe we should add
parentRef.current
to the dependency array for thisuseEffect
hook:visx/packages/visx-responsive/src/hooks/useParentSize.ts
Lines 64 to 83 in 86a851c
Because the
parentRef
is initially null, soobserver.observe(parentRef.current);
is never executed, even ifparentRef
is set to the element after initial render.The text was updated successfully, but these errors were encountered: