Skip to content

Commit

Permalink
react-dom-component(enqueue-put-listener): if we are in SSR, don't ev…
Browse files Browse the repository at this point in the history
…en check if onScroll is supported
  • Loading branch information
RaitoBezarius committed Apr 28, 2016
1 parent 748f597 commit a2f5c59
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/renderers/dom/shared/ReactDOMComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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,
Expand Down

0 comments on commit a2f5c59

Please # to comment.