diff --git a/jsx-runtime/src/index.js b/jsx-runtime/src/index.js index 260d68703e..a3b5278c89 100644 --- a/jsx-runtime/src/index.js +++ b/jsx-runtime/src/index.js @@ -43,17 +43,9 @@ function createVNode(type, props, key, __self, __source) { props: normalizedProps, key, ref, - _children: null, - _parent: null, - _depth: 0, - _dom: null, - _nextDom: undefined, - _component: null, - _hydrating: null, - constructor: undefined, - _original: --vnodeId, __source, - __self + __self, + constructor: undefined }; // If a Component VNode, check for and apply defaultProps. diff --git a/src/create-element.js b/src/create-element.js index 892389054a..9088e737b1 100644 --- a/src/create-element.js +++ b/src/create-element.js @@ -37,7 +37,15 @@ export function createElement(type, props, children) { } } - return createVNode(type, normalizedProps, key, ref, null); + const vnode = { + type, + props: normalizedProps, + key, + ref, + constructor: undefined + }; + if (options.vnode) options.vnode(vnode); + return vnode; } /** @@ -75,9 +83,6 @@ export function createVNode(type, props, key, ref, original) { _original: original == null ? ++vnodeId : original }; - // Only invoke the vnode hook if this was *not* a direct copy: - if (original == null && options.vnode != null) options.vnode(vnode); - return vnode; } diff --git a/src/diff/children.js b/src/diff/children.js index e55fc97017..71b1872822 100644 --- a/src/diff/children.js +++ b/src/diff/children.js @@ -48,7 +48,7 @@ export function diffChildren( childVNode = renderResult[i]; if (childVNode == null || typeof childVNode == 'boolean') { - childVNode = newParentVNode._children[i] = null; + childVNode = null; } // If this newVNode is being reused (e.g.