You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure about the title, the problem is quite specific ~
Issue probably related to #2.
I have this setup with a modal component and inside it a form component. When I click the modal button, the underlying form is submitted through a props change + a willReceiveNewProps in the form.
From what I understand :
When I click the modal button, it sends a new prop (didSubmit) to my form component which is handled in willReceiveNewProps which calls the action. In the action I set the errors in the LocalState which also calls willReceiveNewProps, which means the cleanUp function is called, reseting the LocalState and removing the error immediately. Or something like that.
Form Submit -> Modal didSubmit -> Form willReceiveNewProps (didSubmit == true) -> Form submit is called which calls the action -> action changes LocalState -> cleanUp is called because new prop -> LocalState.get('FORM_ERROR') is null.
I guess I am missing something or I am doing the form handling the wrong way ? How should I be handling this ?
Thanks a lot !
The text was updated successfully, but these errors were encountered:
gabriel-dehan
changed the title
Nested form willReceiveNewProps calls the cleanUp function, reseting the LocalState
Nested form willReceiveNewProps calls the cleanUp function, resetting the LocalState
Apr 2, 2016
Hello there,
Not sure about the title, the problem is quite specific ~
Issue probably related to #2.
I have this setup with a modal component and inside it a form component. When I click the modal button, the underlying form is submitted through a props change + a willReceiveNewProps in the form.
From what I understand :
When I click the modal button, it sends a new prop (
didSubmit
) to my form component which is handled inwillReceiveNewProps
which calls the action. In the action I set the errors in the LocalState which also calls willReceiveNewProps, which means the cleanUp function is called, reseting the LocalState and removing the error immediately. Or something like that.Form Submit -> Modal didSubmit -> Form willReceiveNewProps (didSubmit == true) -> Form submit is called which calls the action -> action changes LocalState -> cleanUp is called because new prop ->
LocalState.get('FORM_ERROR')
isnull
.I have the code here : https://github.com/LoLImprove/Rise/tree/v2/client/modules/replays
NewReplay
is the modal component andReplayForm
is the form component.I guess I am missing something or I am doing the form handling the wrong way ? How should I be handling this ?
Thanks a lot !
The text was updated successfully, but these errors were encountered: