If you're familiar with writing CSS animations, then its quite easy. You would use the same class
as you would in HTML
, but instead name it as className
since class
is a keyword and cannot be used in JSX
.
After defining your animations in CSS
file, simply import
it at the top of your React app.
...
import ./animate.css
...
class Something extends Component {
...
render(){
return (
...
<MyComponent className={*Same as defined in your CSS file*} />
...
And if everything is correct, your animations should show up in your react app. If you use create-react-app
to start your new project, then it already has a logo animation which is defined in the CSS
file. That will give you a decent start, and then you can change stuff from there.