kaori 3 лет назад
Родитель
Сommit
cfee90b5ac

+ 14 - 9
packages/app/src/client/services/AppContainer.js

@@ -104,25 +104,30 @@ export default class AppContainer extends Container {
     return this.containerInstances[className];
   }
 
+
+  /*
+  * Note: Use globalEmitter instaead of registerComponentInstance and getComponentInstance
+  */
+
   /**
    * Register React component instance
    * @param {string} id
    * @param {object} instance React component instance
    */
-  registerComponentInstance(id, instance) {
-    if (instance == null) {
-      throw new Error('The specified instance must not be null');
-    }
+  // registerComponentInstance(id, instance) {
+  //   if (instance == null) {
+  //     throw new Error('The specified instance must not be null');
+  //   }
 
-    this.componentInstances[id] = instance;
-  }
+  //   this.componentInstances[id] = instance;
+  // }
 
   /**
    * Get registered React component instance
    * @param {string} id
    */
-  getComponentInstance(id) {
-    return this.componentInstances[id];
-  }
+  // getComponentInstance(id) {
+  //   return this.componentInstances[id];
+  // }
 
 }

+ 1 - 1
packages/app/src/components/PageEditorByHackmd.tsx

@@ -69,7 +69,7 @@ const PageEditorByHackmd = (props: PageEditorByHackmdProps) => {
         setIsInitialized(false);
       },
     };
-    appContainer.registerComponentInstance('PageEditorByHackmd', pageEditorByHackmdInstance);
+    // appContainer.registerComponentInstance('PageEditorByHackmd', pageEditorByHackmdInstance);
   }, [appContainer, isInitialized, t]);
 
   const getHackmdUri = useCallback(() => {