-
-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Solved] Issue when using listenOrientationChange in hooks #69
Comments
Thank you bro! Working perfectly. |
@EzeMortal yes i did it |
Can this get merged plz, it is really useful. #70 |
Thanks a lot, It helped. |
@anisharya16 I forked it and added the change. https://github.com/Marzdor/react-native-responsive-screen |
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
The text was updated successfully, but these errors were encountered: