diff --git a/packages/react-server/core/components/RootElement.js b/packages/react-server/core/components/RootElement.js index 7c8f21c71..eba34336a 100644 --- a/packages/react-server/core/components/RootElement.js +++ b/packages/react-server/core/components/RootElement.js @@ -175,7 +175,9 @@ RootElement.scheduleRender = function(element) { .then(el => el && (rendered = el)) .then(() => when) .then(childProps => childProps - ?React.cloneElement(rendered, {childProps}) + // merge "when" childProps and "listen" childProps preemptively + // to prevent cloneElement shallow merge from clobbering "listen" childProps + ?React.cloneElement(rendered, {childProps: _.assign({}, rendered.props.childProps || {}, childProps)}) :rendered ) }