GithubHelp home page GithubHelp logo

vjeux / animated Goto Github PK

View Code? Open in Web Editor NEW

This project forked from animatedjs/animated

2.0 2.0 0.0 316 KB

Declarative Animations Library for React and React Native

License: Other

JavaScript 100.00%

animated's Introduction

Animated

Declarative Animations Library for React and React Native

See the interactive docs.

Goal

The goal of this repo is to provide an implementation of the Animated library that is currently provided by React Native that can also be used by React in a web context. At some point, React Native will itself depend on this library.

Additionally, it would be ideal if this library would be compatible with future potential "targets" of React where animation makes sense.

Usage (Still Theoretical)

Right now the main export of this library is essentially just what is in the Animated namespace in React Native, minus the View, Image, and Text namespace. Additionally, it includes an inject namespace (explained below).

Ideally, I'd like to make it so that View, Image, and Text are exported, and just do the "right thing" depending on whether or not they are being used in the context of React Native or React Web. I'm not quite sure how we can do this yet without declaring dependencies on react native. Perhaps the platform specific file extensions can be used for this?

Injectables

There are several parts of this library that need to have slightly different implementations for react-dom than for react-native. At the moment, I've just made these things "injectable" so that this library can stay dependent on only react.

Some of these I am implementing as "injectable", even though right now it would technically work for both platforms. This doesn't hurt anything, and attempts to make this library more compatible with future "targets" for react.

The injectable modules are available off of the Animated.inject namespace, and include:

  • ApplyAnimatedValues
  • FlattenStyle
  • InteractionManager
  • RequestAnimationFrame
  • CancelAnimationFrame

Each of these modules can be injected by passing in the implementation. For example, a naive FlattenStyle could be passed in as:

Animated.inject.FlattenStyle(
  styles => Array.isArray(styles)
    ? Object.assign.apply(null, styles)
    : styles
);

animated's People

Contributors

lelandrichardson avatar sahrens avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.