Closed mistryswapnil-dream11 closed 3 weeks ago
@mistryswapnil-dream11 Hi there may I know why this PR was closed?
@mistryswapnil-dream11 Hi there may I know why this PR was closed?
I accidentally created a pull request here. Also since this repository is no longer maintained we have forked the same and will try to maintain. Forked Repository: https://github.com/dream11/react-native-fast-image The same PR is been raised here: https://github.com/dream11/react-native-fast-image/pull/10
The PR fixes the following #1028.
onError
was not getting invoked when an empty or null source uri was to FastImage.onError
callback was invoked it was not providing and information on why did the error occurred.Scenarios Tested:
When source uri is valid and not reachable, onError should be invoked:
When source uri is empty (""), onError should be invoked:
When source uri is null, onError should be invoked:
When source uri is a fallback source, is valid URL, but not reachable:
export const ImageLoadErrorExample = () => {
const onImageLoadError = (event: OnErrorEvent) => { // Output: Unexpected HTTP code Response{protocol=h2, code=404, message=, url=https://fastly.picsum.photos/id/31} console.log(event.nativeEvent.message) }
return
<FastImage source={{
uri: 'https://fastly.picsum.photos/id/31'
}}
onError={onImageLoadError}
fallback={true}
/>
}