diff --git a/packages/app-js/src/index.tsx b/packages/app-js/src/index.tsx index 404b61e039..7fd46a1626 100644 --- a/packages/app-js/src/index.tsx +++ b/packages/app-js/src/index.tsx @@ -73,12 +73,12 @@ class App extends React.PureComponent { const options: Array = [...customExamples, ...snippets]; const selected = options.find(obj => obj.value === localData.selected); - this.setState((prevState: State): State => ({ + this.setState({ customExamples, isCustomExample: (selected && selected.custom === 'true') || false, options, - snippet: selected || prevState.snippet - }) as State); + snippet: selected || snippets[0] + } as State); } render () {