Created
March 16, 2020 14:18
-
-
Save junaidrahim/0284731335f66b21caeb7f21b7809001 to your computer and use it in GitHub Desktop.
React Loader Example 2
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, { useState } from "react"; | |
import Loader from "react-loader-spinner"; | |
const App = () => { | |
const [spinnerLoading, setSpinnerLoading] = useState(true); | |
return ( | |
<div style={{ textAlign: "center" }}> | |
<br></br> | |
<br></br> | |
<Loader | |
type="Puff" | |
color="#00BFFF" | |
height={100} | |
width={100} | |
visible={spinnerLoading} | |
/> | |
<br></br> | |
<button onClick={() => setSpinnerLoading(!spinnerLoading)}>Toggle Loader</button> | |
</div> | |
) | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment