Skip to content

Commit

Permalink
fix(jsx-runtime): handle keys (vuejs#7976)
Browse files Browse the repository at this point in the history
  • Loading branch information
leopiccionia authored and IAmSSH committed Apr 29, 2023
1 parent 5f0e7ab commit 7a35e1a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/vue/jsx-runtime/index.js
@@ -1,6 +1,11 @@
const { h, Fragment } = require('vue')

function jsx(type, { children, ...props }) {
function jsx(type, props, key) {
const { children } = props
delete props.children
if (arguments.length > 2) {
props.key = key
}
return h(type, props, children)
}

Expand Down
7 changes: 6 additions & 1 deletion packages/vue/jsx-runtime/index.mjs
@@ -1,6 +1,11 @@
import { h, Fragment } from 'vue'

function jsx(type, { children, ...props }) {
function jsx(type, props, key) {
const { children } = props
delete props.children
if (arguments.length > 2) {
props.key = key
}
return h(type, props, children)
}

Expand Down

0 comments on commit 7a35e1a

Please sign in to comment.