FullstackStation / react-native-svg-animated-linear-gradient

A wrap SVG component for animated linear gradient
MIT License
434 stars 110 forks source link

Doesn't animate #12

Open ms-ak opened 6 years ago

ms-ak commented 6 years ago

Here is my code: loopAnimation in library is getting invoked. But, when I try to mount the component (I'm using in development mode), I don't see it animating

My code: App.js

 class App extends Component {
    render() {
        return <SampleLoader/>
    }
} 

SampleLoader.js

import React, { Component } from "react";
import SvgAnimatedLinearGradient from 'react-native-svg-animated-linear-gradient'
import Svg, { Circle, Rect } from 'react-native-svg';
import { Dimensions, View } from "react-native";

//I've locally linked react-native-svg and using that

export default class SampleLoader extends Component{
    render(){
        return (
            <SvgAnimatedLinearGradient height={200}
                                       primaryColor="#7fffd4"
                                       secondaryColor="#ff4500">
                <Rect x="7%" y="24" rx="0" ry="0" width="15%" height="48" />
                <Rect x="7%" y="96" rx="3" ry="3" width="90%" height="7" />
                <Rect x="7%" y="116" rx="3" ry="3" width="90%" height="7" />
                <Rect x="7%" y="136" rx="3" ry="3" width="90%" height="7" />
                <Rect x="7%" y="156" rx="3" ry="3" width="90%" height="7" />
            </SvgAnimatedLinearGradient>
        )
    }
}