From 274ca33959dd75366e339aa6c65ce891b659972f Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Fri, 18 Apr 2014 16:13:18 -0600 Subject: [PATCH] Don't measure height and width unless component is mounted Since we measure in requestAnimationFrame, it's possible to request measurement prior to be unmounted and have it occur afterward. --- src/editor-scroll-view-component.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/editor-scroll-view-component.coffee b/src/editor-scroll-view-component.coffee index e89ffec12..ba2a50755 100644 --- a/src/editor-scroll-view-component.coffee +++ b/src/editor-scroll-view-component.coffee @@ -180,6 +180,8 @@ EditorScrollViewComponent = React.createClass # and use the scrollHeight / scrollWidth as its height and width in # calculations. measureHeightAndWidth: -> + return unless @isMounted() + {editor} = @props node = @getDOMNode() computedStyle = getComputedStyle(node)