plus1tv / react-anime

✨ (ノ´ヮ´)ノ*:・゚✧ A super easy animation library for React!

Home Page:https://codepen.io/collection/nrkjgo/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple translateY will not work for the life of me.

am8525 opened this issue · comments

commented

Really not sure what I'm doing wrong here. Just trying to get a basic translation going so I can start working with the library.

Any ideas?

render(){
		const {classes} = this.props;
		return (
			<div className={classes.landscape}>
				<div className={classes.centerpiece}>
					<Anime translateY={100} loop={true} autoplay={true}>	
						<Dot/>
					</Anime>
				</div>
			</div>
		);
	}
commented

I've figured it out. A little bit of DOM manipulation did the trick:

componentDidMount(){
		const target = ReactDOM.findDOMNode(this);
		anime({
			targets: target.children[0].children,
			translateY: 100,
			loop: true
		});
	}

Note that it's the child of the child because the dot is within a nested div.