Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-transition-view-async

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-transition-view-async

This transition view allows preparation of components before rendering animation. Suitable for showing animations for asynchronous presentation.

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

react-native-transition-view-async

This transition view allows preparation of components before rendering animation. Suitable for showing animations for asynchronous presentation.

npm version NPM

Prerequisites

React Native 0.25 or higher

Installation

npm i react-native-transition-view-async --save

Usage

1. Bootstrap Transition View

import {
  TransitionView,
  FadeTransitionChildView,
  ShowcaseTransitionChildView,
  SlowEnlargeTransitionChildView,
} from 'react-native-transition-view-async'

[...]

render()
{
  return (
    <View style={{flexDirection: 'row', flex: 1}}>
      <TransitionView
        ref={(v) => {this.transitionView = v;}}
        style={{flex: 1}}>
      </TransitionView>
    </View>
  )
}

2. Enqueue View & Consume View

"Enqueue" pushes new component into queue. Transition does not take place yet.

this.transitionView.enqueue(<View ... />, {OPTIONS})

Running "consume()" function triggers the following transitions: a. Fading out of current component b. Fading in of the next component in queue

this.transitionView.consume()
Options Table
KeyTypeValue(s)Mandatory?
SpecificTransitionChildViewReact Component ClassAny inheritance of TransitionChildView: TransitionChildView, FadeTransitionChildView, ShowcaseTransitionChildView, SlowEnlargeTransitionChildViewNo (Default: TransitionChildView)

3. Use case: Screensaver

Demo
const SpecificTransitionChildView = SlowEnlargeTransitionChildView;
this.transitionView.enqueue((
    <View style={{flex: 1, flexDirection: 'row'}}>
        <Image style={{flex: 1, alignSelf: 'stretch', resizeMode: 'stretch'}}
            source={{uri: `https://picsum.photos/2000/2000&t=${new Date().getTime()}`}}
            onLoad={() => {
            
                this.transitionView.consume();
                
                setTimeout(() => {
                    this.onChange();
                }, 3000);
            }}
        />
    </View>
), {
    SpecificTransitionChildView: SpecificTransitionChildView,
});

4. Custom Transitions

All the custom transition components should inherit <TransitionChildView>. To understand how the transition animations are made, refer to our transition examples:

Keywords

FAQs

Package last updated on 09 Mar 2018

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc