Skip to content

Commit fbab4b4

Browse files
committed
fix: fix the bug of nested app registration plugin
1 parent 789b933 commit fbab4b4

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

packages/runtime/core/src/garfish.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,17 +105,11 @@ export class Garfish extends EventEmitter {
105105
options = deepMergeConfig(mainOptions, options);
106106
options = filterNestedConfig(options);
107107

108-
// Isolate global app hooks
109-
this.hooks.usePlugin(
110-
GarfishOptionsLife(
111-
options,
112-
// pluginName is unique
113-
`nested-lifecycle-${numberOfNesting++}`,
114-
)(),
115-
);
116-
options.plugins?.forEach((plugin) =>
117-
this.hooks.usePlugin(plugin(this)),
108+
// `pluginName` is unique
109+
this.usePlugin(
110+
GarfishOptionsLife(options, `nested-lifecycle-${numberOfNesting++}`),
118111
);
112+
options.plugins?.forEach((plugin) => this.usePlugin(plugin));
119113

120114
if (options.apps) {
121115
this.registerApp(

0 commit comments

Comments
 (0)