Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't edit the Email TextInput #66

Closed
LouisJS opened this issue Oct 9, 2017 · 5 comments
Closed

Can't edit the Email TextInput #66

LouisJS opened this issue Oct 9, 2017 · 5 comments

Comments

@LouisJS
Copy link

LouisJS commented Oct 9, 2017

"prop-types": "^15.6.0",
"react": "16.0.0-beta.5",
"react-native": "0.49.1",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-form": "^7.1.0"

The React Native - Redux Form Implementation Guide
3. Connect the form fields to the store using the Field wrapper

Following the guide, when i arrive at this step and add the 'value' property to my InputText, i can't edit it in my iOS Simulator and so my form doesn't work.

Anyone facing this issue ?

@erikras
Copy link

erikras commented Oct 9, 2017

These might be related:

Confirmation that one of these is the cause or solution would be much appreciated.

Att: @jkomyno.

@LouisJS
Copy link
Author

LouisJS commented Oct 10, 2017

Unfortunately, i haven't found any issue nor solution related to mine in your links.
No error is triggered but i don't get the desired output.

This is my form which is called by reduxForm

  <View style={styles.container}>
   <Text>Email:</Text>
   <Field name="email" component={renderInput} />
   <TouchableOpacity onPress={handleSubmit(submit)}>
     <Text style={styles.button}>Submit</Text>
   </TouchableOpacity>
 </View>

And this is what my component looks like

 const renderInput = ({ input: { value, onChange, onBlur, onFocus }}) => {
   return <TextInput
                 style={styles.input}
                 onChangeText={onChange}
                 onBlur={onBlur}
                 onFocus={onFocus}
                 value={value} 
              />
}

The value property freezes the input and the onChangeText doesn't seems to work at all.
When i try to submit my form, it appears as an empty object.

I'm not using Immutable.

@jkomyno
Copy link

jkomyno commented Oct 10, 2017

@erikras, I don't have this issue, if necessary I can provide a gist.

@LouisJS, you don't seem to be passing the onChange prop to

@LouisJS
Copy link
Author

LouisJS commented Oct 10, 2017

@jkomyno Hi. I'm passing the input.onChange method to TextInput with onChangeText.
It is such a simple case, i don't get why it doesn't work properly.

If there any chances you could provide a working example. We would be sure that i did something the wrong way. 👍

@LouisJS LouisJS closed this as completed Oct 11, 2017
@LouisJS LouisJS reopened this Oct 11, 2017
@LouisJS
Copy link
Author

LouisJS commented Oct 11, 2017

Solved.
If it ever happens to you. You might have something wrong with your Redux Store setup (very hard to debug without Redux Dev Tools working on Simulator JS debugger)
Or checkout if your react-native is not too recent. (had to downgrade to 0.42.x <=)

@LouisJS LouisJS closed this as completed Oct 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants