jacklam718 / react-native-modals

A react native modals library. Swipeable. Highly customizable. Support multi modals & Support custom animation. For IOS & Android.
MIT License
2.19k stars 299 forks source link

Warning: Failed prop type: Invalid prop `children` of type `object` supplied to `DialogActionList`, expected an array. #218

Open saidhappy010 opened 4 years ago

saidhappy010 commented 4 years ago

I am using "react-native-popup-dialog", it is really great, but there is a warning that appears on terminal

Warning: Failed prop type: Invalid prop children of type object supplied to DialogActionList, expected an array.

what I noticed is that when I use DialogFooter with 2 children, the warning does not appear, but with one child the warning appears. like that

      <Dialog
        visible={visible}
        dialogTitle={<DialogTitle title="Confirmation" />}
        footer={
          <DialogFooter>
            <DialogButton textStyle={{fontSize:20, color:'green'} } text="Next" />
          </DialogFooter>
        }
      >

please, how to fix this problem?

shemilhashan commented 4 years ago

having the same

yogesh-dalvi commented 3 years ago

I too wanted only one DialogFooter but was receiving the error, so I just added a blank <></> and the error disappeared! Strange

xkungfu commented 3 years ago

I too wanted only one DialogFooter but was receiving the error, so I just added a blank <></> and the error disappeared! Strange

where to added "<></>"?

yogesh-dalvi commented 3 years ago

I too wanted only one DialogFooter but was receiving the error, so I just added a blank <></> and the error disappeared! Strange

where to added "<></>"?

For eg:-

<DialogFooter bordered={false} style={{ marginTop: -15 * ratio }}> <DialogButton text="CANCEL" onPress={() => props.handleCancelClick()} textStyle={{ fontSize: RFValue(dijoriTheme.SIZES.FORTEENPT), fontFamily: "Raleway-Medium" }} align="right" /> <></> </DialogFooter>