Open jspannu919 opened 1 year ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit fe2fb36682b5981b441038a86301b3883c5ce8c7:
Sandbox | Source |
---|---|
final-form/react-final-form | Configuration |
final-form/react-final-form | Configuration |
final-form/react-final-form | Configuration |
final-form/react-final-form | Configuration |
final-form/react-final-form | Configuration |
IMO this is fine, you should not listen for initialValues
after form initialization. Why you need this?
@bslipek In data driven forms (Ref: https://github.com/data-driven-forms/react-forms ) for conditionally hiding the fields, the fields are wrapped with a Field component so that they get re-rendered when the value in any of the parent attribute change(Ref: https://github.com/data-driven-forms/react-forms/blob/84c4cb8861d689cb87ba68100fe7d3acfd667655/packages/react-form-renderer/src/form-renderer/render-form.js#L47). So, due to the above issue the conditional visibility doesn't works if we reverse the order of the fields(Ref: https://stackblitz.com/edit/1dkk8s-rd1ejn?file=schema.js).
I got your point. But still think that this is final-form problem. But I am just a observer here :)
Currently useField doesn't retriggers properly if the initialValue is changed (Added test scenario). Added explicit check for initial value change to prevent deepEqual overheads.