Created
March 27, 2021 21:10
-
-
Save patrickcze/a99250cc0fb59ab5d61d48bb09fb123b to your computer and use it in GitHub Desktop.
An example component using the useOnlineStatus hook
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 from "react"; | |
import { useOnlineStatus } from "../../utilities/useOnlineStatus"; | |
const Home: React.FC = () => { | |
const isOnline = useOnlineStatus(); | |
return <div>I am {isOnline ? "online" : "offline"}!</div>; | |
}; | |
export default Home; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment