Skip to content

Commit

Permalink
fix: fix cloneElement's bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Bless-L committed Mar 16, 2018
1 parent 2c48322 commit dbceca8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nerv/src/clone-element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function cloneElement (vnode, props?: object, ...children): any {
if (isString(vnode)) {
return createVText(vnode)
}
if (!isInvalid(vnode) && isPortal(vnode.vtype, vnode)) {
if (!isInvalid(vnode) && isPortal(vnode.vtype, vnode) || (vnode && (vnode.vtype & VType.Void))) {
return createVoid()
}
const properties = clone(extend(clone(vnode.props), props))
Expand Down

0 comments on commit dbceca8

Please sign in to comment.