diff --git a/src/index.js b/src/index.js index 92585bf..9d073a1 100644 --- a/src/index.js +++ b/src/index.js @@ -25,7 +25,8 @@ export default class Markup extends Component { } } - render({ wrap=true, type, markup, components, reviver, onError, 'allow-scripts':allowScripts, 'allow-events':allowEvents, trim, ...props }) { + render() { + let { wrap=true, type, markup, components, reviver, onError, 'allow-scripts':allowScripts, 'allow-events':allowEvents, trim, ...props } = this.props; let h = reviver || this.reviver || this.constructor.prototype.reviver || customReviver || defaultReviver, vdom; diff --git a/src/markup-to-vdom.js b/src/markup-to-vdom.js index 552a5a7..ec2b381 100644 --- a/src/markup-to-vdom.js +++ b/src/markup-to-vdom.js @@ -21,8 +21,8 @@ export default function markupToVdom(markup, type, reviver, map, options) { let vdom = body && toVdom(body, visitor, reviver, options); visitor.map = null; - - return vdom && vdom.children || null; + // Return VDOM children for reviver (Preact uses children where React uses props.children). + return vdom && (vdom.children || vdom.props.children) || null; } function toCamelCase(name) {