diff --git a/src/ResizeSensor.js b/src/ResizeSensor.js index af38c6e..e52aa1e 100755 --- a/src/ResizeSensor.js +++ b/src/ResizeSensor.js @@ -14,6 +14,10 @@ } }(this, function () { + //Make sure it does not throw in a SSR (Server Side Rendering) situation + if (typeof window === "undefined") { + return null; + } // Only used for the dirty checking, so the event callback count is limted to max 1 call per fps per sensor. // In combination with the event based resize sensor this saves cpu time, because the sensor is too fast and // would generate too many unnecessary events.