react-native-form-generator icon indicating copy to clipboard operation
react-native-form-generator copied to clipboard

Initial Value Example

Open bhavinpankanis opened this issue 7 years ago • 3 comments

Hi Could you provide me with the initial Value example for this as in my use case I need to render a form with some initial values and then change them . Also is it possible for pass initialValues as props to Form component itself.If yes then how and if no then can you tell me the workaround for this.

bhavinpankanis avatar Jan 16 '18 10:01 bhavinpankanis

Yes, you can set values on componentDidMount()

this.refs.informationForm.refs.fullName.setValue('John Doe');
this.refs.informationForm.refs.birthday.setDate(new Date());

pnthach95 avatar Jan 18 '18 12:01 pnthach95

Hey @pnthach95 thanks for the reply. I will give it a try. Could you also help me with this issue https://github.com/MichaelCereda/react-native-form-generator/issues/128

bhavinpankanis avatar Jan 24 '18 12:01 bhavinpankanis

Sorry, I can't help.

pnthach95 avatar Jan 24 '18 13:01 pnthach95