diff --git a/website/src/components/Playground/index.js b/website/src/components/Playground/index.js index be069448..0d5dec09 100644 --- a/website/src/components/Playground/index.js +++ b/website/src/components/Playground/index.js @@ -146,9 +146,8 @@ export default class Playground extends Component { const {selectedNodePath, layoutDefinition} = this.state; if (selectedNodePath) { const index = selectedNodePath.pop(); - const updatedChildren = layoutDefinition - .getIn(getPath(selectedNodePath)) - .delete(index); + const path = getPath(selectedNodePath).concat('children'); + const updatedChildren = layoutDefinition.getIn(path).delete(index); this.modifyAtPath(path, updatedChildren); this.setState({selectedNodePath: null}); } @@ -157,9 +156,8 @@ export default class Playground extends Component { onAdd = () => { const {selectedNodePath, layoutDefinition} = this.state; if (selectedNodePath) { - const updatedChildren = layoutDefinition - .getIn(getPath(selectedNodePath)) - .push(LayoutRecord()); + const path = getPath(selectedNodePath).concat('children'); + const updatedChildren = layoutDefinition.getIn(path).push(LayoutRecord()); this.modifyAtPath( path, updatedChildren, @@ -173,7 +171,6 @@ export default class Playground extends Component { value: any, selectedNodePath?: ?Array = this.state.selectedNodePath, ) { - console.log(setIn); // $FlowFixMe const layoutDefinition = setIn(this.state.layoutDefinition, path, value); this.setState({