Create a component that changes the document title to the number of times a button is clicked.
MediumProblem Statement
Create a component that changes the document title to the number of times a button is clicked.
Sample Input
Initial click count: 0
Sample Output
Document title updates to Clicked 1 times, Clicked 2 times, etc.
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React, { useState, useEffect } from "react"; const ClickTracker = () => { return ( <div> <button>Click Me</button> </div> ); }; export default ClickTracker;