DEV Community

Discussion on: CSS Animation Without CSS - AOS in Plain JS and React

Collapse
 
shareef profile image
Mohammed Nadeem Shareef

I want to add something to the conversation.
If you are using React or NextJS

put your

AOS.init()
Enter fullscreen mode Exit fullscreen mode

Inside a useEffect like so

useEffect(() => {
    AOS.init();
},[])
Enter fullscreen mode Exit fullscreen mode

Without useEffect it will generate an error saying "document is not defined"

Collapse
 
ebereplenty profile image
NJOKU SAMSON EBERE

Thank you very much for your contribution.