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

GiftedFormManager.reset() Not working properly

Open dev-vinoth opened this issue 7 years ago • 3 comments

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.

dev-vinoth avatar May 26 '17 06:05 dev-vinoth

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

kdenz avatar Jun 24 '17 09:06 kdenz

I have the same problem

Maxeh avatar Jul 09 '17 12:07 Maxeh

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.

Maxeh avatar Jul 10 '17 20:07 Maxeh