Getting redux-form error when I import Modal from native-base instead of react-native

17 views Asked by At

I have the following code in my React Native app:

class ModalComponent extends Component {
    render() {
        return (
            <Modal visible={this.props.visible}>
                <View>
                  <View>
                    <Field/>
                  </View>
                  <View>
                    <Field/>
                  </View>
                  <View>
                    <Field/>
                  </View>
                </View>
            </Modal>             
        );
    }
}

ModalComponent =  reduxForm({
    form: 'modalComponentForm'
})(ModalComponent)
export default connect(mapStateToProps, bindAction)(ModalComponent);

Previously I was importing Modal from react-native and it worked fine, but now I'm importing it from native-base and it throws the error Field must be inside a component decorated with reduxForm().

In other posts with this error, it was just a matter of wrapping the component in reduxForm() the way I've done here.

Does anyone know what could be causing this error?

0

There are 0 answers