How to use the rax-animated.ValueXY function in rax-animated

To help you get started, we’ve selected a few rax-animated examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alibaba / rax / examples / drag / src / index.js View on Github external
import {createElement, Component, render, setNativeProps} from 'rax';
import View from 'rax-view';
import PanResponder from 'universal-panresponder';
import Animated from 'rax-animated';

class Drag extends Component {
  state = {
    pan: new Animated.ValueXY(),
    scale: new Animated.Value(1),
  };

  componentWillMount() {
    this._panResponder = PanResponder.create({
      onStartShouldSetPanResponder: this._handleStartShouldSetPanResponder,
      onMoveShouldSetPanResponder: this._handleMoveShouldSetPanResponder,
      onPanResponderGrant: this._handlePanResponderGrant,
      onPanResponderMove: this._handlePanResponderMove,
      onPanResponderRelease: this._handlePanResponderEnd,
      onPanResponderTerminate: this._handlePanResponderEnd,
    });
  }

  render() {
    // Destructure the value of pan from the state
github alibaba / rax / examples / animated / src / index.js View on Github external
import {createElement, Component, render} from 'rax';
import Text from 'rax-text';
import View from 'rax-view';
import Image from 'rax-image';
import Animated from 'rax-animated';

class AnimatedSample extends Component {
  state = {
    bounceValue: new Animated.Value(0),
    translateValue: new Animated.ValueXY({
      x: 0,
      y: 0
    }),
    rotateValue: new Animated.Value(0),
  };

  render() {
    return (

rax-animated

Declarative Animations Library for Rax.

BSD-3-Clause
Latest version published 6 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages