Skip to content
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

airplane mode always returns false inside render method react native android #92

Open
hanaechahid opened this issue Oct 17, 2019 · 0 comments

Comments

@hanaechahid
Copy link

hanaechahid commented Oct 17, 2019

Hello, I'm using this module to detect if airplane mode is enabled or not inside my react native application. when I call the state inside component did mount it returns true if airplane is enabled and false if is disabled, but when I call it on render method it always return false.
this how my code looks:
componentDidMount() { SystemSetting.isAirplaneEnabled() .then((enable) => { this.setState({ airplanemode: enable }) alert(this.state.airplanemode); //here works fine }) // here didn't work fine alert(this.state.airplanemode); }
render method:
render() { alert(this.state.airplanemode) // here always return false return () }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant