You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 () }
The text was updated successfully, but these errors were encountered:
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 () }
The text was updated successfully, but these errors were encountered: