You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

react-native-cdn-image

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-cdn-image

Cache image for your react native app!

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

React native cdn image for remote urls

Cache your images in your react native app easily with width param (optional).

Installing

npm install react-native-cdn-image --save
- or -
yarn add react-native-cdn-image

Usage

import React from 'react';
import CDNImage from 'react-native-cdn-image';

export default class Example extends React.Component
{
    render() {
        return (
            <View>
				<CDNImage style={styles.image} source={{ uri: 'https://example.com/images/1.jpg' }}/>
				<CDNImage source={{ uri: 'https://example.com/images/2.jpg', width: 500 }}/>
				<CDNImage placeholder={'Waiting...'} source={{ uri: 'https://example.com/images/3.jpg' }}/>
			</View>
        );
    }
}

API

clear

You can clear all cached images with clear method. Example:

import CDNImage from 'react-native-cdn-image';

export default class Example extends React.Component
{
    componentWillUnmount()
	{
		CDNImage.clear();
	}
}

Keywords

cache

FAQs

Package last updated on 16 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.