Skip to content

Commit

Permalink
fix: Switch from useLayoutEffect to useEffect for better SSR compatib…
Browse files Browse the repository at this point in the history
…ility
  • Loading branch information
cahilfoley committed Feb 7, 2024
1 parent 7d88fc7 commit 400c0e6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-snowfall/lib/hooks.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react-snowfall/lib/hooks.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/react-snowfall/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useComponentSize = (ref: React.RefObject<HTMLElement>) => {
}
}, [ref])

useLayoutEffect(() => {
useEffect(() => {
const { ResizeObserver } = window

if (!ref.current) return
Expand Down

0 comments on commit 400c0e6

Please sign in to comment.