Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/create-portal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createElement } from './create-element';
import { createVNode } from './create-element';

/**
* Portal component. A unique type is used instead of Fragment so that a
Expand All @@ -16,5 +16,5 @@ function Portal(props) {
* @param {import('./internal').PreactElement} container The DOM node to continue rendering in to
*/
export function createPortal(vnode, container) {
return createElement(Portal, { _parentDom: container }, vnode);
return createVNode(Portal, { _parentDom: container, children: vnode });
}
4 changes: 2 additions & 2 deletions src/render.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EMPTY_OBJ, MODE_HYDRATE, NULL } from './constants';
import { commitRoot, diff } from './diff/index';
import { createElement, Fragment } from './create-element';
import { createVNode, Fragment } from './create-element';
import options from './options';
import { slice } from './util';

Expand Down Expand Up @@ -28,7 +28,7 @@ export function render(vnode, parentDom) {
// means that we are mounting a new tree for the first time.
let oldVNode = isHydrating ? NULL : parentDom._children;

parentDom._children = createElement(Fragment, NULL, [vnode]);
parentDom._children = createVNode(Fragment, { children: [vnode] });

// List of effects that need to be called after diffing.
let commitQueue = [],
Expand Down
Loading