react-native-responsive-dimensions icon indicating copy to clipboard operation
react-native-responsive-dimensions copied to clipboard

fix: effect callback called on each render when dimensions have not changed

Open ninjz opened this issue 3 years ago • 0 comments

The hook useDimensionsListener returns a new object. This results in the hook useDimensionsChange to always call the effect callback on each render since useDimensionsListener() returns a new object each time.

This PR fixes this by using the screen and window properties explicitly as the dependencies for useEffect.

ninjz avatar May 15 '22 08:05 ninjz