naoufal / react-native-progress-hud

A clean and lightweight progress HUD for your React Native app.

Home Page:https://www.npmjs.com/package/react-native-progress-hud

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Required context was not specified

blaesus opened this issue · comments

commented

I keep getting this annoying error in title when I user ProgressHUD, detail as follows:

image

If I remove the isRequired in ProgressHUD source code (line 25), I will no longer get it.

  contextTypes: {
    showProgressHUD: React.PropTypes.func.isRequired,  // Remove isRequired here will solve it
    dismissProgressHUD: React.PropTypes.func
  },

The render function looks like this

render() {
  // Something else
        <ProgressHUD
          isVisible={this.props.hudVisible}
          isDismissible={false}
          overlayColor="rgba(0, 0, 0, 0.11)"
        />
}

What can I do here?