Created
August 7, 2021 19:29
-
-
Save 0kzh/0075044b53feb288cba037289775df21 to your computer and use it in GitHub Desktop.
Code to render a Lottie animation using React
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 animationData from "./loading.json"; | |
import { Player } from "@lottiefiles/react-lottie-player"; | |
const App = () => { | |
return ( | |
<div className="App"> | |
<Player | |
autoplay | |
loop | |
src={animationData} | |
style={{ height: "50%", width: "50%" }} | |
/> | |
</div> | |
); | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment