react-jsonschema-form
react-jsonschema-form copied to clipboard
Schema dependency Failed prop type ERROR
Prerequisites
- [x] I have read the documention
Description
When using schema dependencies, it causes an error.
Steps to Reproduce
var schema = {
"type": "object",
"properties": {
"name": { "type": "string" },
"credit_card": { "type": "string" }
},
"required": ["name"],
"dependencies": {
"credit_card": {
"properties": {
"billing_address": { "type": "string" }
}
}
}
}
Actual behavior
When I try to enter a value in dependency field this error shows up:
warning.js:33 Warning: Failed prop type: The prop
id
is marked as required inBaseInput
, but its value isundefined
. in BaseInput (created by TextWidget) in TextWidget (created by Unknown) in Unknown (created by StringField) in StringField (created by SchemaField) in div (created by DefaultTemplate) in DefaultTemplate (created by SchemaField) in SchemaField (created by ObjectField) in fieldset (created by DefaultObjectFieldTemplate) in DefaultObjectFieldTemplate (created by ObjectField) in ObjectField (created by SchemaField) in div (created by DefaultTemplate) in DefaultTemplate (created by SchemaField) in SchemaField (created by Form) in form (created by Form) in Form
Version
1.0.0
Yeah, having the same issue. The problem seems to be that an id is not being generated for each of the new fields that are being added as part of the dependency schema.
Hello, same issue here. How do you manage to manually add the id ?
Hey, submitted a PR for this, #778 Please take a look. This is a very important feature for us, and we need it back as soon as possible
Hi, somebody found how fix that issue?
When I use the < Form />, its works for me, but I'm using SchemaField, instead of Form, so can't find a way how to fix The prop id is marked as required in BaseInput, but its value is undefined.
Any update on this issue? I am having a similar issue with dynamic schema dependency. The schema is not getting modified with the change of formData.
Hi @anudeesh, I found some workaround, have a look on Form component at my form-builder repo