diff --git a/src/lib/AstRenderer.js b/src/lib/AstRenderer.js index 532e0cf..3407968 100644 --- a/src/lib/AstRenderer.js +++ b/src/lib/AstRenderer.js @@ -2,10 +2,6 @@ import React, { Component, PropTypes } from "react"; import { Text, View } from "react-native"; import getUniqueID from "./util/getUniqueID"; -export function rootRenderRule(children, styles) { - return {children}; -} - /** * */ @@ -66,6 +62,7 @@ export default class AstRenderer { */ render = nodes => { const children = nodes.map(value => this.renderNode(value, [])); - return rootRenderRule(children, this._style); + const root = { type: "root", key: getUniqueID() }; + return this.getRenderFunction(root.type)(root, children, null, this._style); }; } diff --git a/src/lib/renderRules.js b/src/lib/renderRules.js index 67a180c..932f7e5 100644 --- a/src/lib/renderRules.js +++ b/src/lib/renderRules.js @@ -7,6 +7,10 @@ import hasParents from './util/hasParents'; import applyStyle from './util/applyStyle'; const renderRules = { + root: (node, children, parent, styles) => ( + { children } + ), + // when unknown elements are introduced, so it wont break unknown: (node, children, parent, styles) => { return (