tkrotoff / react-form-with-constraints

Simple form validation for React
MIT License
126 stars 20 forks source link

Crash "Can't perform a React state update on an unmounted component" #43

Open phong-steph opened 5 years ago

phong-steph commented 5 years ago
react-dom.development.js?61bb:506 Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.
    in Async (created by Coordonnees)
    in FieldFeedbacks (created by Coordonnees)
    in div (created by FormSectionGroup)
    in FormSectionGroup (created by Coordonnees)
    in Coordonnees (created by EtapePrincipale)
    in div (created by FormSection)
    in div (created by FormSection)
    in section (created by FormSection)
    in FormSection (created by EtapePrincipale)
    in fieldset (created by EtapePrincipale)
    in form (created by FormWithConstraints)
    in FormWithConstraints (created by EtapePrincipale)
    in div (created by EtapePrincipale)
    in EtapePrincipale (created by component)
    in component (created by Context.Consumer)

Context: the form (with hooks) performs a validation with Async, the validation is not done yet while the form is re-rendered (because the upper state has changed).