Skip to content

Commit

Permalink
chore: better warning when remounting a mounted app (#1297)
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin authored Jun 11, 2020
1 parent ad4841a commit 0b93440
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/runtime-core/src/apiCreateApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ export function createAppAPI<HostElement>(
return vnode.component!.proxy
} else if (__DEV__) {
warn(
`App has already been mounted. Create a new app instance instead.`
`App has already been mounted.\n` +
`If you want to remount the same app, move your app creation logic ` +
`into a factory function and create fresh app instances for each ` +
`mount - e.g. \`const createMyApp = () => createApp(App)\``
)
}
},
Expand Down

0 comments on commit 0b93440

Please sign in to comment.