react-native-gifted-form
react-native-gifted-form copied to clipboard
edit field editable programmically
Is there any way to edit field editable programmically? I want to add a "edit" button to enable the all field editable = true
Hi,
You can do it by editing the containers state.
constructor(params) {
super(params);
this.state = {
emailEditable: false
}
}
Then on the field:
<GiftedForm.TextInputWidget
name='email'
title='Email:'
editable={this.state.emailEditable}
/>
Then in your button:
_toggleEditable() {
this.setState({emailEditable: !this.state.emailEditable});
}