FaridSafi / react-native-gifted-form

📝 « One React-Native form component to rule them all »
MIT License
1.44k stars 214 forks source link

GiftedFormManager.reset() Not working properly #96

Open dev-vinoth opened 7 years ago

dev-vinoth commented 7 years ago

When I used to clear the form using GiftedFormManager.reset() It only cleared the state value of the form but display values are not cleared.

how to clear the display values?

help me to fix this issue ASAP.

kdenz commented 7 years ago

@dev-vinoth same problem here. @FaridSafi both reset and resetValues doesn't clear display values of the form.

Maxeh commented 7 years ago

I have the same problem

Maxeh commented 7 years ago

I guess I have found the reason for this behavior (at least it works for me now). It occurs when you use your own state or redux instead of the GiftedFormManager as described here. You have to use a value prop on your widgets, which refer to your state. When you clear your state, the values of the TextInputs are cleared.

=> When you store the form's value in your own state, the methods of GiftedFormManager do not work.