Yuki Takei 1 год назад
Родитель
Сommit
29714c0189

+ 1 - 1
packages/editor/src/client/services/use-codemirror-editor/use-codemirror-editor.ts

@@ -42,7 +42,6 @@ export const useCodeMirrorEditor = (props?: UseCodeMirror): UseCodeMirrorEditor
 
   const mergedProps = useMemo(() => {
     return deepmerge(
-      props ?? {},
       {
         // Reset settings of react-codemirror.
         // Extensions are defined first will be used if they have the same priority.
@@ -61,6 +60,7 @@ export const useCodeMirrorEditor = (props?: UseCodeMirror): UseCodeMirrorEditor
         },
         // ------- End -------
       },
+      props ?? {},
     );
   }, [props]);
 

+ 1 - 3
packages/editor/src/client/stores/codemirror-editor.ts

@@ -28,10 +28,8 @@ export const useCodeMirrorEditorIsolated = (
   const swrKey = key != null ? `codeMirrorEditor_${key}` : null;
   const mergedProps = useMemo<UseCodeMirror>(() => {
     return deepmerge(
+      { container },
       props ?? {},
-      {
-        container,
-      },
     );
   }, [container, props]);