_From @JensonMiralles on April 16, 2018 3:26_
VictoryLine is not working when adding animate prop (React Native)
_Copied from original issue: FormidableLabs/victory#972_
@JensonMiralles
This issue is caused by a change in react-native-svg@^6.2.x. Since this change ClipPath components are not updating their widths which causes animating line and area charts to always be rendered with a 0 width ClipPath.
You can get around this by:
1) Using an earlier version of react-native-svg. Compatible versions are described here
2) Replacing the groupComponent in VictoryLine with a standard <G/> tag. You will not see curtaining transitions (no more 'onLoad' transitions, or nice transitions for changing numbers of data points), but regular animations will work correctly.
Oh okay, got that! thanks! 馃榿
@boygirl can you elaborate on the second part im trying this and getting invariant violation errors:
<VictoryLine
groupComponent={"<G/>"}
style={{
data: { stroke: "red" },
parent: { border: "1px solid #ccc" }
}}
data={data1}
x="x"
y="y"
/>
still not working when using
"react-native-svg": "^6.1.4",
@boygirl
@waltermvp you will need to omit the ^ in your version, as this is breaking with [email protected]
@waltermvp you can also try groupComponent={<G/>}. It needs to be an element, not a string.
@boygirl got it working, thank you so very much.
This issue is fixed with [email protected]
Most helpful comment
@JensonMiralles
This issue is caused by a change in
react-native-svg@^6.2.x. Since this changeClipPathcomponents are not updating their widths which causes animating line and area charts to always be rendered with a 0 widthClipPath.You can get around this by:
1) Using an earlier version of
react-native-svg. Compatible versions are described here2) Replacing the
groupComponentinVictoryLinewith a standard<G/>tag. You will not see curtaining transitions (no more 'onLoad' transitions, or nice transitions for changing numbers of data points), but regular animations will work correctly.