Untitled
unknown
plain_text
6 months ago
369 B
5
Indexable
4. Identify the issue in the following component’s state management and suggest a better approach. function Counter() { const [count, setCount] = useState(0); const increment = () => { setCount(count + 1); setCount(count + 1); }; return ( <div> <p>Count: {count}</p> <button onClick={increment}>Increment</button> </div> ); }
Editor is loading...
Leave a Comment