react-in-viewport
Advanced tools
@@ -21,3 +21,3 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
var isStateless = function isStateless(Component) { | ||
return !Component.prototype.render; | ||
return typeof Component === 'function' && !(Component.prototype && Component.prototype.isReactComponent); | ||
}; | ||
@@ -24,0 +24,0 @@ |
@@ -37,3 +37,3 @@ 'use strict'; | ||
var isStateless = function isStateless(Component) { | ||
return !Component.prototype.render; | ||
return typeof Component === 'function' && !(Component.prototype && Component.prototype.isReactComponent); | ||
}; | ||
@@ -40,0 +40,0 @@ |
{ | ||
"name": "react-in-viewport", | ||
"version": "0.0.30", | ||
"version": "0.0.31", | ||
"description": "Track React component in viewport", | ||
@@ -5,0 +5,0 @@ "author": "Roderick Hsiao <roderickhsiao@gmail.com>", |
@@ -10,3 +10,6 @@ if (typeof window !== 'undefined') { | ||
const isStateless = Component => !Component.prototype.render; | ||
const isStateless = (Component) => ( | ||
typeof Component === 'function' | ||
&& !(Component.prototype && Component.prototype.isReactComponent) | ||
) | ||
@@ -13,0 +16,0 @@ function handleViewport( |
337910
0.06%639
0.47%