Open hoanglam10499 opened 4 years ago
Thank you bro! Working perfectly. Can you do a PR?
@EzeMortal yes i did it
Can this get merged plz, it is really useful. #70
Solved:
const [ state, setstate ] = React.useState(null);
React.useEffect(() => {
listenOrientationChange(setstate);
return () => {
removeOrientationListener();
};}, []);
And Package:
if (that.setState == null) {
that(screenWidth < screenHeight ? 'portrait' : 'landscape');
} else {
that.setState({
orientation: screenWidth < screenHeight ? 'portrait' : 'landscape'
});}
Hope it helps everyone
Thanks a lot, It helped.
@anisharya16 I forked it and added the change.
https://github.com/Marzdor/react-native-responsive-screen I plan to just use the fork until he merges the change
will this one be merged in? it's been months.
Solved:
const [ state, setstate ] = React.useState(null);
React.useEffect(() => {
listenOrientationChange(setstate);
return () => {
removeOrientationListener();
};}, []);
And Package:
if (that.setState == null) {
that(screenWidth < screenHeight ? 'portrait' : 'landscape');
} else {
that.setState({
orientation: screenWidth < screenHeight ? 'portrait' : 'landscape'
});}
Hope it helps everyone