-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onLoad, onError, onLoadStart and onLoadEnd do not fire for Image. #18502
Comments
Thanks for posting this! It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.54? Thank you for your contributions. |
updated react-native and description |
Same problems on android. 7.1.1 Image error uri: http://media.hottab.net/uploads/api.hottabpos.com/206/thumbs/HeaderLogo_5bajVUqT.png |
This comment has been minimized.
This comment has been minimized.
Issue persists using latest and greatest as of today |
Anyone know what version of React-Native these event handlers worked? Specifically onError. onLoad, onLoadStart and onLoadEnd work on v55.4 for both ios and android for me. But onError does not. I need to provide a placeholder image when the Image fails to load correctly. |
None of the loading or error handlers on v55.4 work for me... |
The same issue here :( |
It does work, it just depends on the implementation. For example, this code below works, it fires the constructor(props) {
super(props);
this.state = { loaded: false };
}
_finishLoading = function () {
console.log("Finished loading");
this.setState({ loaded: true });
}
render = function () {
return <Image onLoadEnd={this._finishLoading.bind(this)} {...this.props} />;
} However, this code below does not work at all (it's a non-working LazyImage implementation): constructor(props) {
super(props);
this.state = { loaded: false };
}
_finishLoading = function () {
console.log("Finished loading");
this.setState({ loaded: true });
}
render = function () {
var image = <Image onLoadEnd={this._finishLoading.bind(this)} {...this.props} />;
return this.state.loaded ? image : <Image {...this.props} source={Loader} />;
} I'm assuming it's not firing the event because the |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information. |
Environment
Steps to Reproduce
Expected Behavior
Should work as described in documentation
documentation
Actual Behavior
onLoad, onError, onLoadStart and onLoadEnd do not fire for Image, on both IOS and Android platforms
The text was updated successfully, but these errors were encountered: