A component for image with indicator and default image
React Native Indicator Image
A component for image with indicator and default image
Installation
$ npm install @unpourtous/react-native-image-indicator --save
Usage
import CustomImage from '@unpourtous/react-native-image-indicator'
<CustomImage
style={{alignItems: 'center', justifyContent: 'center', height:300,width:300, backgroundColor: '#fdf9e6'}}
source={'image url'}
defaultImage={require('./images/default.jpg')}
errorImage={require('./images/error.png')}
/>
API
Props
source
The remote URL image source.
type: string
defaultImage
The image before remote image loaded
type: number
errorImage
The image when remote image loade failed
type: number
renderIndicator
the function that render indicator component(exclusion indicator when renderIndicator setted)
type: function
indicator
the indicator component when image is loading
type: function
indicatorProps
the props of indicator component
type: object
threshold
delay milliseconds before indicator component show
type: number
defaultValue: 50
License
This library is distributed under MIT Licence.