Skip to content

Commit dae0953

Browse files
author
jonisaa
committed
Solved all errors! Yay!!
1 parent 0e010d7 commit dae0953

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

demo/components/LiveSchemaEditorForm.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,19 @@ class LiveSchemaEditorForm extends Component {
1818
));
1919
};
2020

21+
getNewProps = (prop) => {
22+
const {initialValue, autofill, onUpdate, valid, invalid, dirty, pristine, active, touched, visited, autofilled, ...rest} = prop;
23+
24+
return rest;
25+
};
26+
2127
render() {
2228
const { fields: {entityName, layoutName, schema}, selectedPreset, formOptionActions } = this.props;
23-
29+
const newLayout = this.getNewProps(layoutName);
30+
const newEntity = this.getNewProps(entityName);
31+
const newSchema = this.getNewProps(schema);
32+
33+
console.log(JSON.stringify(newLayout))
2434
return <div>
2535
<div className='row'>
2636
<div className="col-md-12">
@@ -44,7 +54,7 @@ class LiveSchemaEditorForm extends Component {
4454
<ControlLabel>
4555
Entity name
4656
</ControlLabel>
47-
<FormControl type="text" value="" placeholder="Enter text" { ... entityName }/>
57+
<FormControl type="text" value="" placeholder="Enter text" {...newEntity}/>
4858
<FormControl.Feedback />
4959
</FormGroup>
5060
</div>
@@ -53,7 +63,7 @@ class LiveSchemaEditorForm extends Component {
5363
<ControlLabel>
5464
Layout name
5565
</ControlLabel>
56-
<FormControl type="text" value="" placeholder="Enter text" { ...layoutName }/>
66+
<FormControl type="text" value="" placeholder="Enter text" {...newLayout}/>
5767
<FormControl.Feedback />
5868
</FormGroup>
5969
</div>
@@ -64,7 +74,7 @@ class LiveSchemaEditorForm extends Component {
6474
<ControlLabel>
6575
Schema
6676
</ControlLabel>
67-
<CodeEditor { ...schema} />
77+
<CodeEditor { ...newSchema}/>
6878
<FormControl.Feedback />
6979
</FormGroup>
7080
</div>

0 commit comments

Comments
 (0)