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

react-flip-book

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-flip-book

A React component for making state transitions from a list of props

latest
Source
npmnpm
Version
0.2.2
Version published
Maintainers
1
Created
Source

react-flip-book

npm version

A React component for making state transition from a list of props

(日本語)

Installation

It can not be used directly by the browser.

You need to use a bundler like browserify/webpack.

npm install --save react-flip-book

Usage

If you animate this component..

import React from 'react';

class MyAwesomeMessage extends React.Component {
  render() {
    return <div style={ { color: this.props.color } }>{ this.props.message }</div>;
  }
}

..then wrap by FlipBook meta-component with both realProps and transition.

import FlipBook from 'react-flip-book';

const realProps = {
  color: 'black',
  message: 'Finish',
};

const transition = [
  {
    duration: 1000,
    color: 'red',
    message: 'One',
  },
  {
    duration: 500,
    color: 'green',
    message: 'Two',
  },
  {
    duration: 250,
    color: 'blue',
    message: 'Three',
  },
];

const transitionalMessage = <FlipBook realProps={ realProps } transition={ transition }>
  { props => <MyAwesomeMessage { ...props } /> }
</FlipBook>;

In this case, the component will change like this:

1. red "One"
  |
(1000ms)
  |
2. green "Two"
  |
(500ms)
  |
3. blue "Three"
  |
(250ms)
  |
4. black "Finish"

Features

  • Without changing the original components, you can apply a simple flip animation, such as a cartoon
  • If you set [] to transition, that is same as normal rendering

Keywords

react

FAQs

Package last updated on 14 Feb 2016

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