diff --git a/src/core/render.ts b/src/core/render.ts index 32cacfa..864a08e 100644 --- a/src/core/render.ts +++ b/src/core/render.ts @@ -1,5 +1,5 @@ import { toNodeArr, HNode } from "./HNode"; -import { _document, _assign, _from } from "../utils/refCache"; +import { _document, _assign, _from, _create, _null } from "../utils/refCache"; import { createStore, Store, StoreType, StoreHandlers, HandlerMap } from "./Store"; import { toFrag } from "../utils/helpers"; import { DeferCallback, reqTick, willTick } from "../ticker/ticker"; @@ -17,7 +17,7 @@ export interface RenderOptions { } export const renderToDOM = function render( - src: any, options: RenderOptions = {} + src: any, options: RenderOptions = _create(_null) ) { const { parent = _document.body, diff --git a/src/utils/refCache.ts b/src/utils/refCache.ts index 6602dcd..71c8923 100644 --- a/src/utils/refCache.ts +++ b/src/utils/refCache.ts @@ -11,7 +11,7 @@ export const _document = document, _console = console, { now: _now } = Date, _requestAnimationFrame = requestAnimationFrame, - { assign: _assign, is: _is, keys: _keys, entries: _entries } = _Object, + { assign: _assign, is: _is, keys: _keys, entries: _entries, create: _create } = _Object, { toString: _toString, hasOwnProperty: _hasOwnProperty } = _Object.prototype, { isArray: _isArray, from: _from } = _Array, { splice: _splice, push: _push, indexOf: _indexOf } = _Array.prototype,