Skip to content

Instantly share code, notes, and snippets.

@Wanuja97
Created August 13, 2022 16:02
Show Gist options
  • Save Wanuja97/e32b61c1fec72c8029f0a1f6e41155b6 to your computer and use it in GitHub Desktop.
Save Wanuja97/e32b61c1fec72c8029f0a1f6e41155b6 to your computer and use it in GitHub Desktop.
AOS animation in a functional component
import React,{useEffect} from "react";
// importing aos
import AOS from 'aos';
import 'aos/dist/aos.css';
export default function MyFunctionalComponent() {
useEffect(() => {
AOS.init();
}, [])
return (
<div
data-aos="fade-left" //Here you can use any of the AOS animations
>
MyFunctionalComponent
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment