From 4580f931999d660e7a970bba6268a2d8d6fb4910 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 12 Dec 2016 14:26:07 +0000 Subject: [PATCH] Use fbjs requestAnimationFrame in Image --- src/components/Image/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Image/index.js b/src/components/Image/index.js index 8a58b209..57b9903e 100644 --- a/src/components/Image/index.js +++ b/src/components/Image/index.js @@ -2,6 +2,7 @@ import applyNativeMethods from '../../modules/applyNativeMethods'; import ImageResizeMode from './ImageResizeMode'; import ImageStylePropTypes from './ImageStylePropTypes'; +import requestAnimationFrame from 'fbjs/lib/requestAnimationFrame'; import StyleSheet from '../../apis/StyleSheet'; import StyleSheetPropType from '../../propTypes/StyleSheetPropType'; import View from '../View'; @@ -193,7 +194,7 @@ class Image extends Component { this._imageState = status; const isLoaded = this._imageState === STATUS_LOADED; if (isLoaded !== this.state.isLoaded) { - window.requestAnimationFrame(() => { + requestAnimationFrame(() => { if (this._isMounted) { this.setState({ isLoaded }); }