Create a component that tracks and displays how many times each button in a group of buttons has been clicked.
MediumProblem Statement
Create a component that tracks and displays how many times each button in a group of buttons has been clicked.
Sample Input
Buttons: ["Button 1", "Button 2", "Button 3"]
Sample Output
Each button displays its own click count.
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
import React, { useState } from "react";
const ButtonClickTracker = () => {
return (
<div>
{/* Render buttons with click counts */}
</div>
);
};
export default ButtonClickTracker;
Input
Buttons: ["Button 1", "Button 2", "Button 3"]
Expected Output
Each button displays its own click count.