ClipPath animation is broken
See original GitHub issueThe following code works on 4.6.1 and doesn’t on 5.1.3:
import React, { Component } from 'react';
import { Animated, Easing, AppRegistry, View } from 'react-native';
import { ClipPath, Defs, Path, Rect, Svg } from 'react-native-svg';
class Clipped extends Component {
render() {
const { clipWidth } = this.props;
return <Svg width="340" height="110" viewBox="0 0 340 110">
<Defs>
<ClipPath id="clip">
<Rect x={clipWidth} y={0} width={340 - clipWidth} height={110} />
</ClipPath>
</Defs>
<Path stroke="rgba(0, 0, 0, 0.2)" strokeLinecap="round" strokeWidth={7} fill="none" d="M10,100 C100,-10 240,-10 330,100" clipPath="url(#clip)"> /</Path>
</Svg>;
}
}
const AnimatedClipped = Animated.createAnimatedComponent(Clipped);
export default class ClipTest extends Component {
constructor() {
super();
this._width = new Animated.Value(0);
}
componentDidMount() {
Animated.timing(
this._width,
{
toValue: 150,
easing: Easing.inOut(Easing.ease),
duration: 500
}
).start();
}
render() {
return <AnimatedClipped clipWidth={this._width} />;
}
}
AppRegistry.registerComponent('ClipTest', () => ClipTest);
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
Clip-path animation not working - GSAP - GreenSock
The clip-path animation in the mentioned code pen is not working. Can someone please point out what am I doing wrong?
Read more >ClipPath animation is broken · Issue #251 - GitHub
It worked on 4.5.0 but doesn't work on 4.6.1 I found that you fix TouchEvents do not work properly with ClipPath. Maybe this...
Read more >Animating clip-path in safari not working - Stack Overflow
I am working on a simple css animation of the clip-path property, using the basic inset shape to create a sweep effect.
Read more >Animation Clip Path completely broken and displays "Missing ...
Animation Clip Path completely broken and displays "Missing!" Best way to fix? I tried everything. I'm creating an animation with a nested ...
Read more >1118710 - SVG mask animation is not working
Both are animated using the same css animation. Actual results: Only the regular div is moving, animation is not working on an element...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
4.5.0 or 4.6.1. Sorry about this, I’m quite busy those days, I’ll fix this as soon as I can.
I can confirm this.