I need help please I started using react in my first project and I'm facing a problem with installing wow js I searched a lot on the internet but all I found was old methods that don't work now someone help, please
CodePudding user response:
Install the dependency first
npm install wowjs
then import in the required component
import WOW from 'wowjs';
and in a method componentDidMount
(for class components) or a hook useEffect
(for functional) create an instance and initiate
componentDidMount() {
new WOW.WOW({
live: false
}).init();
}
useEffect(() => {
new WOW.WOW({
live: false
}).init();
}, [])