There was an error while loading. Please reload this page.
1 parent af046a6 commit eae5751Copy full SHA for eae5751
1 file changed
src/components/code-editor/index.jsx
@@ -33,7 +33,8 @@ export default function CodeEditor(props) {
33
const [_, setEditor] = useState(null);
34
35
useEffect(() => {
36
- if (editor.current && (!props.baseExampleSlug || !props.value)) return;
+ console.log('editor code:\n', props.value);
37
+ if (editor.current && !props.baseExampleSlug) return;
38
if (editor.current) editor.current.destroy();
39
40
const theme = EditorView.theme({}, { dark: true });
@@ -66,7 +67,7 @@ export default function CodeEditor(props) {
66
67
});
68
69
setEditor(editor.current);
- }, [props.value, props.baseExampleSlug]);
70
+ }, [props.baseExampleSlug]);
71
72
useEffect(() => (
73
() => {
0 commit comments