import React, { useState, useEffect } from "react";
export default function App() {
const [count, setCount] = useState(0);
useEffect(() => {
const timeout = setTimeout(() => {
setCount(1);
}, 3000);
},[]);
return (
<div className="App">
<h1>{count}</h1>
<button onClick={() => setCount(count + 1)}>Increment</button>
</div>
);
}