Sobes.tech
Intern — Senior

Analysis of behavior when pressing the button

livecode

Task condition

Determine how the application's state will change after clicking the button.

 export default function CounterApp()
    let currentCount = 0;

const increment = () => {
    currentCount += 1;
    }
return (
    <div className="App">
    <p>'What will happen when clicking the button</p>
    <hi>Count = {currentCount}</hi>
    <button onClick={increment}-'button</button>
    </div>
});