Skip to content

Instantly share code, notes, and snippets.

@code08-ind
Created March 29, 2021 19:44
Show Gist options
  • Save code08-ind/a849eadd8529ea38c10d9c9980ef3abd to your computer and use it in GitHub Desktop.
Save code08-ind/a849eadd8529ea38c10d9c9980ef3abd to your computer and use it in GitHub Desktop.
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