Easy
You're building a React component for a weather dashboard. Which implementation correctly updates the temperature display?
1function WeatherDisplay() {2 const [temp, setTemp] = useState(20);34 const updateTemp = () => {5 setTemp(temp + 1);6 setTemp(temp + 1);7 setTemp(temp + 1);8 };910 return (11 <div>12 <p>Temperature: {temp}°C</p>13 <button onClick={updateTemp}>Increase</button>14 </div>15 );16}