Skip to content

Instantly share code, notes, and snippets.

@naveennagan
Created July 19, 2019 09:55
Show Gist options
  • Save naveennagan/fd540190cc1b6ec720b8ae1fecb7dfbd to your computer and use it in GitHub Desktop.
Save naveennagan/fd540190cc1b6ec720b8ae1fecb7dfbd to your computer and use it in GitHub Desktop.
import React, { useState } from 'react';
function Home() {
const [count, setCount] = useState(0);
return (
<div>
<p>You visited {count} times</p>
<button onClick={() => setCount(count + 1)}>
Visit
</button>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment