Functional reactive forms. Multi-layer validation, custom styling, field grouping, reactive props, and much more.
217
stars
24
forks
source link
FormProvider: "rules" updates passed via context do not update "Form.state.rules" #362
Closed
kettanaito closed 5 years ago
Environment
What
Current behavior
The updates of
FormProvider.props.rules
is never reflected in theForm.state.rules
, and it may contain obsolete values.Expected behavior
Value updates in
FormProvider.props.rules
is reflected properly inForm.state.rules
.Why
https://github.com/kettanaito/react-advanced-form/blob/75862b77c9778e29bd87bd6edb6596c5142a3caf/src/components/Form.jsx#L145
Compares prev and next props, while rules may also come from FormProvider context.
How
Need to check if the context rules have changed, and if they had, update the state.