Last active
          November 6, 2021 23:20 
        
      - 
      
- 
        Save szaranger/c1569c2313145df3fdaae9f73188bfe8 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or 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"; | |
| function App() { | |
| const [count, setCount] = useState(0); | |
| function handleClick(){ | |
| return (setTimeout(() => { | |
| alert("You clicked on: " + count); | |
| }, 3000)); | |
| } | |
| return ( | |
| <div> | |
| <p>You clicked {count} times</p> | |
| <button onClick={() => setCount(count + 1)}>Click me</button> | |
| <button onClick={handleClick}>Show alert</button> | |
| </div> | |
| ); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment