Skip to content

Commit 54b1d9a

Browse files
committed
Add a renderRootComponent:false option, which skips invoking render() on a component located at the root of the given JSX tree.
Example: `render(<Foo>a</Foo>)==='<Foo>a</Foo>'`
1 parent edd667e commit 54b1d9a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default function renderToString(vnode, context, opts, inner) {
8282

8383
// components
8484
if (typeof nodeName==='function') {
85-
if (opts && opts.shallow && inner) {
85+
if (opts && opts.shallow && (inner || (opts && opts.renderRootComponent===false))) {
8686
nodeName = getComponentName(nodeName);
8787
}
8888
else {

0 commit comments

Comments
 (0)