Skip to content

Instantly share code, notes, and snippets.

@kasiriveni
Created December 27, 2018 03:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasiriveni/4e00354489c1ada878737c75ad97b4ee to your computer and use it in GitHub Desktop.
Save kasiriveni/4e00354489c1ada878737c75ad97b4ee to your computer and use it in GitHub Desktop.
import React, { useState } from "react";
function Count() {
const [mycount, mysetCount] = useState(0);
return (
<div>
<p>you clicked {mycount}</p>
<button onClick={() => mysetCount(mycount + 1)}>Click me</button>
</div>
);
}
export default Count;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment