From a4c4848ff428401ca243dc87c9205619363c6732 Mon Sep 17 00:00:00 2001 From: Dylan Vann Date: Wed, 25 Apr 2018 02:55:56 -0400 Subject: [PATCH] Format and refactor capturing ref. --- index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 2b0127d..161586e 100644 --- a/index.js +++ b/index.js @@ -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 ( (this._root = e)} + ref={this.captureRef} {...props} style={style} source={source} @@ -63,8 +65,7 @@ class FastImage extends Component { const resolvedSource = resolveAssetSource(source) return ( - (this._root = e)}> +