1

When I am trying to wrap redux form into the react-native elements it shows following error.

enter image description here

this is my code

import React,{ Component } from 'react';
import { Field,reduxForm } from 'redux-form';
import { Text,Input } from 'react-native-elements';
import { View,Button } from 'react-native';

 const renderField=({label,keyboardType,name}) => {
    return(
            <View style={{flexDirection:'row',height:50,alignItems:'center' }}>
                <Text>
                    {label}
                </Text>
                <Input />
            </View>
    )
}

const RegisterForm=props => {
    const {handleSubmit}=props;
    return(
            <View style={{flex:1,flexDirection:'column',margin:40,justifyContent:'flex-start'}}>

                <Field label="Username" component={renderField} name="username" />
                <Button title='SUBMIT' onPress={handleSubmit} />

            </View>
    )
}
const Register=reduxForm({
    form:'register',
})(RegisterForm);
export default Register;

When used FormInput in react-native elements it works then I am changed it into react-native elements 1.0.0beta4 and replace the formInput with Input component. After that it shows above error.My debugger window also shows an error

debugger window enter image description here

Pranab V V
  • 1,386
  • 5
  • 27
  • 53

1 Answers1

1

The error is due to your upgrade to react-native-elements beta which include breaking changes like the button component props :

The actual error is located in welcomePage.js file (as you can see in debugger), you need to change the object you pass to the button icon prop to a react component (see the button doc in the link above).

Dyo
  • 4,429
  • 1
  • 15
  • 30
  • when i trying to install react-native in linux it doen't work,after i followed this link [https://stackoverflow.com/questions/44446523/unable-to-load-script-from-assets-index-android-bundle-on-windows/47035389] helps me to solve the problem. – Pranab V V Apr 11 '18 at 06:41
  • but I am failed to open the debugger window,i will uploaded the issue in 1hr and sent that link.can you help me? – Pranab V V Apr 11 '18 at 06:43
  • please check this link [https://stackoverflow.com/questions/49768865/unable-to-connect-with-remote-logger-issue-in-react-nativeandroid-in-linux] – Pranab V V Apr 11 '18 at 07:21