Explorar el Código

add reset method

yuken hace 3 años
padre
commit
33f8bcd3c6
Se han modificado 1 ficheros con 3 adiciones y 7 borrados
  1. 3 7
      packages/app/src/components/PageEditorByHackmd.jsx

+ 3 - 7
packages/app/src/components/PageEditorByHackmd.jsx

@@ -57,17 +57,13 @@ const PageEditorByHackmd = (props) => {
 
         return hackmdEditorRef.current.getValue();
       },
+      reset: () => {
+        setIsInitialized(false);
+      },
     };
     appContainer.registerComponentInstance('PageEditorByHackmd', pageEditorByHackmdInstance);
   }, [appContainer, isInitialized, t]);
 
-  /**
-   * reset initialized status
-   */
-  const reset = () => {
-    setIsInitialized(false);
-  };
-
   const getHackmdUri = useCallback(() => {
     const envVars = appContainer.getConfig().env;
     return envVars.HACKMD_URI;