react-native-gesture-handler icon indicating copy to clipboard operation
react-native-gesture-handler copied to clipboard

Fix `useLayoutEffect` throwing warnings when using SSR

Open latekvo opened this issue 9 months ago • 0 comments

Warning

This PR may cause a regression, more info here.

Test SSR + react-freeze before pushing any of these changes!

Description

Using useLayoutEffect in combination with SSR results in a warning. This PR adds a useSafeLayoutEffect, which acts as useLayoutEffect in regular apps, and defaults to useEffect when using SSR.

fixes https://github.com/software-mansion/react-native-gesture-handler/issues/3375

Test plan

latekvo avatar Feb 06 '25 12:02 latekvo