import React , {useState} from 'react'

const addCon = () = >{
    console.log(useState(0));
    
    const [count,setCount] = useState(0)
    const handelAdd = () = >{
        let newCount = count;
        setCount(newCount+=1)}return (
        <div>
            <p>{count}</p>
            <button onClick={handelAdd}>add</button>
        </div>)}export default addCon
Copy the code