Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply animate.css update #64

Open
bhawanishiv opened this issue Feb 26, 2021 · 4 comments
Open

Apply animate.css update #64

bhawanishiv opened this issue Feb 26, 2021 · 4 comments

Comments

@bhawanishiv
Copy link

I found that the library is still using older version of animate.css. I would like to add newer version support here.

@omnibrain
Copy link

Do you know the last working animate.css version?

@I-am-abdulazeez
Copy link

version: 4.1.1

@oxypomme
Copy link

oxypomme commented Jan 26, 2022

It's because in v4.1.1 of animate.css, all the class names are prefixed by animate__.

If anyone is searching for a workaround, I've created a component who "upgrade" class names (it still apply class animate tho, and it don't work with custom transitions).

import React from "react";
import "animate.css";
import ScrollAnimation from "react-animate-on-scroll";

function Animated({
	children,
        animateIn,
	animateOut,
	...props
}) {
	return (
		<ScrollAnimation
			{...props}
			className={`animate__animated ${className ?? ""}`}
			animateIn={animateIn && `animate__${animateIn}`}
                        animateOut={animateOut &&`animate__${animateOut}`}
		>
			{children}
		</ScrollAnimation>
	);
}

export default Animated;

@dannysze
Copy link

It is because animate.css is updated. However, it would be cleaner to animate.compat.css instead of adding animate__ prefix for each animation.

import "animate.css/animate.compat.css";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants