Skip to content

Commit

Permalink
initialize rect with getBoundingClientRect
Browse files Browse the repository at this point in the history
  • Loading branch information
KurtGokhan committed Aug 8, 2023
1 parent bb61368 commit 2ee40c9
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export function useResizeObserver<T extends HTMLElement = any>() {
useIsomorphicEffect(() => {
if (ref.current) {
observer.observe(ref.current);
setRect(ref.current.getBoundingClientRect());
}

return () => {
Expand Down

0 comments on commit 2ee40c9

Please sign in to comment.