Skip to content

Commit 0b93440

Browse files
authored
chore: better warning when remounting a mounted app (#1297)
1 parent ad4841a commit 0b93440

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/runtime-core/src/apiCreateApp.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,10 @@ export function createAppAPI<HostElement>(
225225
return vnode.component!.proxy
226226
} else if (__DEV__) {
227227
warn(
228-
`App has already been mounted. Create a new app instance instead.`
228+
`App has already been mounted.\n` +
229+
`If you want to remount the same app, move your app creation logic ` +
230+
`into a factory function and create fresh app instances for each ` +
231+
`mount - e.g. \`const createMyApp = () => createApp(App)\``
229232
)
230233
}
231234
},

0 commit comments

Comments
 (0)