https://github.com/robinpowered/react-native-android-image-polyfill
An Image component that polyfills onError behavior
https://github.com/robinpowered/react-native-android-image-polyfill
Last synced: about 1 year ago
JSON representation
An Image component that polyfills onError behavior
- Host: GitHub
- URL: https://github.com/robinpowered/react-native-android-image-polyfill
- Owner: robinpowered
- Created: 2016-11-30T00:13:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-22T12:34:14.000Z (almost 7 years ago)
- Last Synced: 2024-04-14T06:47:08.117Z (about 2 years ago)
- Language: JavaScript
- Homepage: https://github.com/facebook/react-native/issues/7440
- Size: 3.91 KB
- Stars: 6
- Watchers: 6
- Forks: 4
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
An Image component to polyfill Android's `onError` callback.
There are some blocking challenges with the Fresco library used for Android's images. This acts as a solution by using `Image.prefetch`, which will indicate if an image fails to resolve. Further discussion can be found in https://github.com/facebook/react-native/issues/7440#issuecomment-263740877.
# Installation
```
npm install react-native-android-image-polyfill --save
```
# Usage
```js
import Image from 'react-native-android-image-polyfill';
// Use it like a normal image
class YourComponent extends React.Component {
render () {
return (
alert('Failed!')}
/>
);
}
}
```