Skip to content

Commit a05497f

Browse files
committed
Fixed JSON code not validated anymore in the playground.
1 parent fdd426e commit a05497f

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

playground/app.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,15 @@ class Editor extends Component {
175175
}
176176

177177
onCodeChange = (code) => {
178-
try {
179-
this.setState({valid: true, code});
180-
setImmediate(() => this.props.onChange(fromJson(this.state.code)));
181-
} catch(err) {
182-
console.error(err);
183-
this.setState({valid: false, code});
184-
}
178+
this.setState({valid: true, code});
179+
setImmediate(() => {
180+
try {
181+
this.props.onChange(fromJson(this.state.code));
182+
} catch(err) {
183+
console.error(err);
184+
this.setState({valid: false, code});
185+
}
186+
});
185187
};
186188

187189
render() {

0 commit comments

Comments
 (0)