0.0.1 • Published 6 years ago

react-native-smartimage v0.0.1

Weekly downloads
10
License
-
Repository
-
Last release
6 years ago

SmartImage

need screens here

Installation

  • Using npm:

    npm install git+https://git@github.com/volga-volga/react-native-smartimage.git`

NOTE:

It use react-native-fetch-blob and react-native-fs. After installation you need to call

react-native link

Props

    static propTypes = {
        source: PropTypes.string,
        // When use both source and localSource, localSource will be shown.
        localSource: Image.propTypes.source, 
        placeholder: Image.propTypes.source,
        renderPlaceholder: PropTypes.element,
        style: Image.propTypes.style,
        placeholderStyle: View.propTypes.style,
        imageProps: Image.propTypes,
    }

Example

import SmartImage from 'react-native-smartimage';

...

render() {
    return (
        <SmartImage 
            style = {{
                borderRadius: 8,
                height: 40,
                width: 40,
            }}
            placeholderStyle = {{
                bacgroundColor: 'green'
            }}
            imageProps = {{
                blurRadius: 10
            }}
            // Use for cache image (only network images)
            source = {urlToImage}
            // Use for local images or images without cache
            localSource = {{uri: pathToImage}}
            />    
    )
}