New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

rn-image-sequence

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

rn-image-sequence

An image sequence component for react-native

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

rn-image-sequence

A package that uses native modules for creating animations from a sequence of images.

Based off of the react-native-image-sequence package by Mads Jensen (https://github.com/madsleejensen/react-native-image-sequence)

Installation

npm install rn-image-sequence --save

or

yarn add rn-image-sequence

Install with autolinking (RN > 0.60) [iOS Only]

cd ios && pod install && cd ..

react-native link rn-image-sequence

Examples

Basic Usage

import ImageSequence from 'rn-image-sequence';

const images = [
  require('1.jpg'),
  require('2.jpg'),
  require('3.jpg')
]

const SomeComponent: React.FunctionComponent = (props) => {
  return (
    <View>
      <ImageSequence 
        images={images} 
        framesPerSecond={30} 
        loop={false}  
      />
    </View>
  )
}

Customizing loops

The ImageSequence component has a prop that takes two required arguments that correspond to the indicies of the frames you would like the loop to play. This example code below will loop from the first frame to the 2nd frame.

import ImageSequence from 'rn-image-sequence';

const images = [
  require('1.jpg'),
  require('2.jpg'),
  require('3.jpg')
]

const SomeComponent: React.FunctionComponent = (props) => {
  return (
    <View>
      <ImageSequence
        images={images} 
        framesPerSecond={30} 
        loop={false}  
        loopInfo={{ loopFrom: 0, loopTo: 1 }}
      />
    </View>
  )
}

Keywords

animated

FAQs

Package last updated on 18 Oct 2020

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