brewRenderer: Capture event properties while still in event loop.

React [pools events](https://github.com/facebook/react/issues/2850),
which means that once the lambda runs later on the properties we want
to read will be null. Instead, we capture the properties in the event
loop.
This commit is contained in:
Rae Che authored and Trevor Buckner committed 2018-08-20 14:14:52 -04:00
1 parent 5ab7c29b9d
commit f6b058f3c9
1 file changed
+2 -1
@@ -58,8 +58,9 @@ const BrewRenderer = createClass({
},
handleScroll : function(e){
let target = e.target;
this.setState((prevState)=>({
viewablePageNumber : Math.floor(e.target.scrollTop / e.target.scrollHeight * prevState.pages.length)
viewablePageNumber : Math.floor(target.scrollTop / target.scrollHeight * prevState.pages.length)
}));
},