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.
This commit is contained in:
Nathan Sobo
2014-04-18 16:13:18 -06:00
parent 10d6ec156f
commit 274ca33959

View File

@@ -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)