I want to show Network Activity Indicator in my iOS app status bar. How can I call static setNetworkActivityIndicatorVisible method in react native dynamically?
2 Answers
You can set a reference inside the StatusBar component, and you'll have access to it's static methods.Just call this.statusBar.setNetworkActivityIndicatorVisible(boolean) in the parent component.
<StatusBar backgroundColor="blue" barStyle="light-content" ref={(statusBar) => this.statusBar = statusBar} />