소스 검색

Allow props to be nullable

Shun Miyazawa 1 년 전
부모
커밋
59bbac2760
2개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 0 1
      packages/editor/src/client/components/CodeMirrorEditorReadOnly.tsx
  2. 1 1
      packages/editor/src/client/stores/codemirror-editor.ts

+ 0 - 1
packages/editor/src/client/components/CodeMirrorEditorReadOnly.tsx

@@ -68,7 +68,6 @@ export const CodeMirrorEditorReadOnly = ({ markdown, onScroll }: Props): JSX.Ele
       hideToolbar
       editorKey={GlobalCodeMirrorEditorKey.READONLY}
       onScroll={onScroll}
-      cmProps={{}} // Do not pass undefined when initializing useCodeMirrorEditorIsolated
     />
   );
 };

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

@@ -33,7 +33,7 @@ export const useCodeMirrorEditorIsolated = (
 
   const newData = useCodeMirrorEditor(mergedProps);
 
-  const shouldUpdate = swrKey != null && container != null && props != null && (
+  const shouldUpdate = swrKey != null && container != null && (
     currentData == null
     || (isValid(newData) && !isDeepEquals(currentData, newData))
   );