Closed GoPro16 closed 5 years ago
closed via #144
1 - Store a var that will say when the component is unmounted, and then if it is unmounted prevent the state update to the
AvForm
I'm getting the state update warning like #98 and #101, but on version 2.6.0.
The component using <AvForm>
is mounted then immediately destroyed.
I placed logs before all calls to setState()
in AvForm.js
and got:
UserBox unmounting...
inside AvForm - setError
Warning: Can't perform a React state update on an unmounted component.
Seems to be in the setError()
function.
Currently, when we submit anything in the
AvForm
thehandleSubmit
method will fire off all the validation methods. After all the prop functions are called the Form sets asubmitted
state that is used to display aclassName
on the form wrapper. However, there is no class in our uikit that uses this and its not helpful since in some cases we redirect the user to a page and then get a warning about unmounting.Code Link Where Unmounting Error Occurs
We have 2 Options:
1 - Store a var that will say when the component is unmounted, and then if it is unmounted prevent the state update to the
AvForm
2 - Remove the submitted state logic as a whole.