Created
August 13, 2022 16:00
-
-
Save Wanuja97/82a6190aa936452d2eb05fd6d6bc8111 to your computer and use it in GitHub Desktop.
AOS animation in a class component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
// importing aos | |
import AOS from 'aos'; | |
import 'aos/dist/aos.css'; | |
export default class MyClassComponent extends Component { | |
componentDidMount() { | |
AOS.init(); | |
} | |
render() { | |
return ( | |
<div | |
data-aos="fade-right" //Here you can use any of the AOS animations | |
> | |
MyClassComponent | |
</div> | |
) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment