Scoreboard2
import React, { useCallback, useState } from "react";
export default function App(){
const [score , setScore] = useState(0);
return(
<div className="cricket">
<h1 style={{ fontSize: "40px"}}>{score}</h1>
<button style={{display: "inline" }} onClick={()=>setScore((count)=>count+4)}>+</button>
<button style={{display: "inline"}} onClick={()=>setScore((count)=>count+1)}>-</button>
</div>
)
};
Comments
Post a Comment