import React, { useState } from 'react'; function Example() { // Declare a new state variable, which we'll call "count" const [count, setCount] = useState(0); return ( <div> <p>You clicked {count} times</p> <button onClick={() => setCount(count + 1)}> Click me </button> </div> ); }
![DeckDeckGo](https://cdn-ak-scissors.b.st-hatena.com/image/square/fc21d834fb2a5309068d38cc7a6415b8119862c6/height=288;version=1;width=512/https%3A%2F%2Fdeckdeckgo.com%2Fassets%2Fmeta%2Fdeckdeckgo-meta.png)