Allow formData to be passed as props in EntityForm
authorFrank Bessou <frank.bessou@logilab.fr>
Thu, 11 May 2017 10:29:13 +0200
changeset 193 3c032c1c33c8
parent 192 74c9a8eed1ef
child 194 968657b3534c
Allow formData to be passed as props in EntityForm
src/components/Entity.js
--- a/src/components/Entity.js	Wed May 10 16:33:28 2017 +0200
+++ b/src/components/Entity.js	Thu May 11 10:29:13 2017 +0200
@@ -238,7 +238,7 @@
 
     constructor(props, context) {
         super(props, context);
-        this.state = {schema: props.schema, formData: null, uiSchema: uiSchema, _errors: null};
+        this.state = {schema: props.schema, formData: props.formData, uiSchema: uiSchema, _errors: null};
     }
 
     render() {
@@ -277,6 +277,7 @@
     onSubmit: PropTypes.func,
     schema: PropTypes.object,
     errors: PropTypes.object,
+    formData: PropTypes.any,
 };
 
 EntityForm.contextTypes = {