question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ClipPath animation is broken

See original GitHub issue

The 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:closed
  • Created 7 years ago
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
magicismightcommented, Feb 20, 2017

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.

2reactions
AlbertBrandcommented, Feb 15, 2017

I can confirm this.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found