react-jsonschema-form
react-jsonschema-form copied to clipboard
Bug: issue with dependencies computeDefaults (#4271)
Reasons for making this change
fixes #4271
Fix is to first get the defaults from the properties if set, to ensure the dependencies conditions are resolved based on it. Then we can get the dependencies defaults.
The issue was caused by the **load**
method in the playground and not by the formData editor
as I explained in #4271. The **load**
method updates the formData
state because it is initially set to samples.Simple.formData
after the component has mounted. This triggers the form componentDidUpdate
which will try to get computedDefaults
again.