Skip to content

Commit

Permalink
fix(jsx-runtime): fix automatic runtime implementation (#7959)
Browse files Browse the repository at this point in the history
  • Loading branch information
remcohaszing committed Mar 28, 2023
1 parent bcf5841 commit 5838950
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
14 changes: 10 additions & 4 deletions packages/vue/jsx-runtime/index.js
@@ -1,4 +1,10 @@
const Vue = require('vue')
exports.jsx = Vue.h
exports.jsxDEV = Vue.h
exports.Fragment = Vue.Fragment
const { h, Fragment } = require('vue')

function jsx(type, { children, ...props }) {
return h(type, props, children)
}

exports.jsx = jsx
exports.jsxs = jsx
exports.jsxDEV = jsx
exports.Fragment = Fragment
13 changes: 12 additions & 1 deletion packages/vue/jsx-runtime/index.mjs
@@ -1 +1,12 @@
export { h as jsx, h as jsxDEV, Fragment } from 'vue'
import { h, Fragment } from 'vue'

function jsx(type, { children, ...props }) {
return h(type, props, children)
}

export {
Fragment,
jsx,
jsx as jsxs,
jsx as jsxDEV
}
5 changes: 5 additions & 0 deletions packages/vue/package.json
Expand Up @@ -43,6 +43,11 @@
"import": "./jsx-runtime/index.mjs",
"require": "./jsx-runtime/index.js"
},
"./jsx-dev-runtime": {
"types": "./jsx-runtime/index.d.ts",
"import": "./jsx-runtime/index.mjs",
"require": "./jsx-runtime/index.js"
},
"./jsx": {
"types": "./jsx.d.ts"
},
Expand Down

0 comments on commit 5838950

Please sign in to comment.