Skip to content

feat: replace createApp with render and createVNode #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@ export default <TProps = any>(

React.useEffect(() => {
// @ts-expect-error
if (Vue.createApp) {
if (Vue.createVNode) {
// @ts-expect-error
const app = Vue.createApp({
// @ts-expect-error
render: () => Vue.h(Component, (passProps && passProps(props)) || {})
})
app.mount(el.current)
const vm = Vue.createVNode(Component, (passProps && passProps(props)) || {})
// @ts-expect-error
Vue.render(vm, el.current)

return () => app.unmount()
// @ts-expect-error
return () => Vue.render(null, el.current)
} else if (Vue.default) {
const app = new Vue.default({
// @ts-expect-error
Expand Down