We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fad8b64 commit 5c1465bCopy full SHA for 5c1465b
packages/storybook/src/editor-spring.story.js
@@ -135,21 +135,24 @@ function SingleEditor({
135
}).then(code => setCode(code))
136
}, [inputCode])
137
138
- const step = {
139
- files: [
140
- {
141
- name: "index.js",
142
- code,
143
- focus,
144
- annotations,
+ const step = React.useMemo(
+ () => ({
+ files: [
+ {
+ name: "index.js",
+ code,
+ focus,
145
+ annotations,
146
+ },
147
+ ],
148
+ northPanel: {
149
+ tabs: ["index.js"],
150
+ active: "index.js",
151
+ heightRatio: 1,
152
},
- ],
- northPanel: {
- tabs: ["index.js"],
- active: "index.js",
- heightRatio: 1,
- },
- }
153
+ }),
154
+ [code, focus]
155
+ )
156
157
return code ? (
158
<EditorSpring {...step} codeConfig={{ theme }} />
0 commit comments