From f0198a35d454e8b2c1c6cd06257d717fe3c0fdb4 Mon Sep 17 00:00:00 2001 From: Stefanie Doll Date: Tue, 19 Feb 2019 18:28:16 +0100 Subject: [PATCH] Bugfix: Editor doesn't update onLoad if no custom example is selected (#732) --- packages/app-js/src/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 () {