Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support animating Svg Path d attribute on android #176

Closed

Commits on Jan 23, 2019

  1. Support animating Svg Path d attribute on android

    software-mansion/react-native-svg#908
    
    ```jsx
    import * as React from 'react';
    import { View, StyleSheet } from 'react-native';
    import { Svg, Path } from 'react-native-svg';
    import Animated from 'react-native-reanimated';
    
    const { concat, multiply } = Animated;
    const x = multiply(1, 2);
    const y = multiply(2, 3);
    const path = concat('M 0 0 L ', x, ' ', y);
    
    const AnimatedPath = Animated.createAnimatedComponent(Path);
    
    export default class App extends React.Component {
      render() {
        return (
          <View style={styles.container}>
            <Svg viewBox="0 0 10 10" width="100" height="100">
              <AnimatedPath d={path} stroke="black" />
            </Svg>
          </View>
        );
      }
    }
    
    const styles = StyleSheet.create({
      container: {
        flex: 1,
        alignItems: 'center',
        justifyContent: 'center',
        backgroundColor: '#ecf0f1',
      },
    });
    ```
    msand committed Jan 23, 2019
    Configuration menu
    Copy the full SHA
    be87477 View commit details
    Browse the repository at this point in the history