diff --git a/src/components/App/index.js b/src/components/App/index.js index 9b4109d..009c171 100644 --- a/src/components/App/index.js +++ b/src/components/App/index.js @@ -146,7 +146,7 @@ class App extends React.PureComponent { }; return - { syntax &&
} + diff --git a/src/components/Form/index.js b/src/components/Form/index.js index e7dc39e..bf8167a 100644 --- a/src/components/Form/index.js +++ b/src/components/Form/index.js @@ -20,6 +20,15 @@ class Form extends React.PureComponent { syntax: this.context.syntax } + componentDidUpdate() { + if (this.state.expr === undefined && this.state.syntax === undefined) { + this.setState({ + syntax: this.context.syntax, + expr: this.context.expr + }); + } + } + handleSubmit = event => { event.preventDefault();