marudy / react-native-responsive-screen

Make React Native views responsive for all devices with the use of 2 simple methods
MIT License
1.55k stars 140 forks source link

Proposed change: Dimensions API to the useWindowDimensions hook. #134

Open gmemmy opened 2 years ago

gmemmy commented 2 years ago

Hey there @marudy, I love this package and the work that has been put into it. I have a suggestion about moving from the Dimensions API provided by react-native to the useWindowDimensions hook newly provided by react native, as this automatically updates width and height values when screen size changes. I believe this eliminates the need for an event listener to detect when screen dimensions have changed(landscape/portrait). If you concur with this, I can raise a PR to this effect.

fdelavra commented 2 years ago

Did you applied this change ? It will be very usefull to correct window size change bugs on ONE UI 3 and 4 on Samesung devices

gmemmy commented 2 years ago

Did you applied this change ? It will be very usefull to correct window size change bugs on ONE UI 3 and 4 on Samesung devices

I did locally in a project where I use this package and it works.

fdelavra commented 2 years ago

Can you explain me how you apply the change ? I tried without success