Skip to content

Commit

Permalink
Dev comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cee-chen authored Feb 8, 2024
1 parent d723a09 commit 384ee9f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src-docs/src/views/resize_observer/resize_observer_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const ResizeObserverHookExample = () => {
setItems((items) => [...items, `Item ${items.length + 1}`]);
};

// Note: This must be a `useState` and not a `useRef` to correctly update on mount & unmount
const [resizeRef, setResizeRef] = useState();
const dimensions = useResizeObserver(resizeRef);

Expand Down

0 comments on commit 384ee9f

Please sign in to comment.