Victor Zarzu
Victor Zarzu

Reputation: 87

I use react-native-popup-dialog and I get some warns

I installed react-native-popup-dialog and I use it. I get the same warn when I enter the page with the component or when I open the popup dialog. Can you help me?

The error: "Warning: Failed prop type: Prop 'children' has type 'any' or 'mixed', but was not provided to 'PopupDialog'. Pass undefined or any other value"

<Dialog
  visible = {this.state.addVisible}
  rounded
  width = {0.85}
  dialogAnimation={new SlideAnimation({
      slideFrom: 'bottom',
    })}
  footer = {
    <DialogFooter>
      <DialogButton
        onPress = {() => {}}
        textStyle = {styles.buttonText}
        text = "Add"
      />
      <DialogButton
        onPress = {() => this.setState({addVisible: false})}
        textStyle = {styles.buttonText}
        text = "Cancel"
      />
    </DialogFooter>
  }
>
</Dialog>

Upvotes: 0

Views: 799

Answers (1)

MoKhajavi75
MoKhajavi75

Reputation: 2702

According to issues:

It's type warning. children is required for DialogContent component.

Please add that like this:

<Dialog
    visible={this.state.visible}
    onTouchOutside={() => {
      this.setState({ visible: false });
    }}
  >
    <DialogContent>
      {...}
    </DialogContent>
  </Dialog>

Upvotes: 1

Related Questions