Created
March 29, 2021 19:44
-
-
Save code08-ind/a849eadd8529ea38c10d9c9980ef3abd to your computer and use it in GitHub Desktop.
This file contains 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 useIncrement from './useIncrement'; | |
const Increment = () => { | |
document.title = "Chats"; | |
const [state, setState] = useState(0); | |
useIncrement(state); | |
const IncrementOnClick = () => { | |
setState(state + 1); | |
} | |
return ( | |
<> | |
<div className="container"> | |
<h1>{state}</h1> | |
<button onClick={IncrementOnClick}>Click To Increment</button> | |
</div> | |
</> | |
); | |
} | |
export default Increment; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment