diff --git a/src/renderers/dom/shared/ReactDOMComponent.js b/src/renderers/dom/shared/ReactDOMComponent.js index d2c77fe1cd7b7..5f592e837c9ed 100644 --- a/src/renderers/dom/shared/ReactDOMComponent.js +++ b/src/renderers/dom/shared/ReactDOMComponent.js @@ -210,6 +210,13 @@ function assertValidProps(component, props) { } function enqueuePutListener(inst, registrationName, listener, transaction) { + var containerInfo = inst._nativeContainerInfo; + var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; + var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument; + if (!doc) { + // Server rendering. + return; + } if (__DEV__) { // IE8 has no API for event capturing and the `onScroll` event doesn't // bubble. @@ -218,13 +225,6 @@ function enqueuePutListener(inst, registrationName, listener, transaction) { 'This browser doesn\'t support the `onScroll` event' ); } - var containerInfo = inst._nativeContainerInfo; - var isDocumentFragment = containerInfo._node && containerInfo._node.nodeType === DOC_FRAGMENT_TYPE; - var doc = isDocumentFragment ? containerInfo._node : containerInfo._ownerDocument; - if (!doc) { - // Server rendering. - return; - } listenTo(registrationName, doc); transaction.getReactMountReady().enqueue(putListener, { inst: inst,