Format and refactor capturing ref.

This commit is contained in:
Dylan Vann 2018-04-25 02:55:56 -04:00
parent 30c2d966e4
commit a4c4848ff4
1 changed files with 4 additions and 3 deletions

View File

@ -30,6 +30,8 @@ class FastImage extends Component {
this._root.setNativeProps(nativeProps)
}
captureRef = e => (this._root = e)
render() {
const {
source,
@ -47,7 +49,7 @@ class FastImage extends Component {
if (useLocalImage(source)) {
return (
<Image
ref={e => (this._root = e)}
ref={this.captureRef}
{...props}
style={style}
source={source}
@ -63,8 +65,7 @@ class FastImage extends Component {
const resolvedSource = resolveAssetSource(source)
return (
<View style={[style, styles.imageContainer]}
ref={e => (this._root = e)}>
<View style={[style, styles.imageContainer]} ref={this.captureRef}>
<FastImageView
{...props}
style={StyleSheet.absoluteFill}