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

AOS doesn't work properly in React invisible component #697

Open
maksym1015 opened this issue Jul 21, 2021 · 1 comment
Open

AOS doesn't work properly in React invisible component #697

maksym1015 opened this issue Jul 21, 2021 · 1 comment

Comments

@maksym1015
Copy link

Hello, @michalsnik

I used AOS to my Create React App.
But it works on the visible component but doesn't work properly on the invisible component.

When I inspect the site it didn't apply to the aos-animate class name to the invisible component.

Ofc, I all did
import AOS from "aos";
import "aos/dist/aos.css";

useEffect(() => {
AOS.init({
startEvent: "DOMContentLoaded",
offset: 200,
duration: 3000,
once: true,
});
}, []);

Already, read the above solutions but have not found the solution.
Hope you solve this problem ASAP.

Max

@fyalavuz
Copy link

fyalavuz commented Sep 9, 2022

if you call AOS.init outside of component (after imports), it works.

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

2 participants