Skip to content

Commit

Permalink
fix(jsx-runtime): handle keys (#7976)
Browse files Browse the repository at this point in the history
  • Loading branch information
leopiccionia authored Mar 29, 2023
1 parent 0f73f39 commit ff60b93
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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 ff60b93

Please sign in to comment.