diff --git a/packages/@productled/core/src/Productled.ts b/packages/@productled/core/src/Productled.ts index 29a4adb..7ca7092 100644 --- a/packages/@productled/core/src/Productled.ts +++ b/packages/@productled/core/src/Productled.ts @@ -31,6 +31,7 @@ class Productled { this.documentService = new DocumentService(); this.configStore = new ConfigStore(); this.routeListener = new RouteListener(); + this.routeListener.addListener(this.routeChanged.bind(this)); } /** @@ -58,7 +59,7 @@ class Productled { * @param {string} url - The URL of the new route * @returns {Promise} */ - public routeChanged(url: string) { + private routeChanged(url: string) { const hooks = this.hookStore.getHooks(url); const hookExecuter = new HookExecuter(this.pluginStore, this.documentService); @@ -78,7 +79,6 @@ class Productled { // Get the hooks for the plugin and add them to the hook store const hooks = this.configStore.getHooks(pluginName); this.hookStore.addHooks(hooks, pluginName); - this.routeListener.addListener(this.routeChanged.bind(this)); } } diff --git a/packages/samples/react-sample/src/App.tsx b/packages/samples/react-sample/src/App.tsx index 3848d5a..774de2d 100644 --- a/packages/samples/react-sample/src/App.tsx +++ b/packages/samples/react-sample/src/App.tsx @@ -4,16 +4,12 @@ import Page from './Page'; // Import the existing page component import HomePage from './HomePage'; // Import another page component (create this if it doesn't exist) import SubPage from './SubPage'; // Import the sub-page component (create this if it doesn't exist) import NavBar from './NavBar'; -import ProductledInit from './ProductledInit'; const App: React.FC = () => { - - return (
- {/* Use the NavBar component */} } /> diff --git a/packages/samples/react-sample/src/ProductledInit.tsx b/packages/samples/react-sample/src/ProductledInit.tsx deleted file mode 100644 index 0ae2f7e..0000000 --- a/packages/samples/react-sample/src/ProductledInit.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; - -const ProductledInit: React.FC = () => { - return null; -} - -export default ProductledInit;