From b8b2c6488503d0660488b6a13b5b36bdb1911eff Mon Sep 17 00:00:00 2001 From: Ragularuban Date: Fri, 15 Mar 2019 18:19:51 +0530 Subject: [PATCH] Added `onLoad` event --- src/Image.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Image.js b/src/Image.js index 06c370e..e369992 100644 --- a/src/Image.js +++ b/src/Image.js @@ -15,7 +15,8 @@ type ImageProps = { options?: DownloadOptions, uri: string, transitionDuration?: number, - tint?: "dark" | "light" + tint?: "dark" | "light", + onLoad? Function }; type ImageState = { @@ -42,6 +43,7 @@ export default class Image extends React.Component { const path = await CacheManager.get(uri, options).getPath(); if (this.mounted) { this.setState({ uri: path }); + this.props.onLoad && this.props.onLoad(path); } } }