The handler does not change the state.
Acceptance criteria
- 1.Adding should show 2.
The handler does not change the state.
function App() { const [count, setCount] = React.useState(1) return ( <div> <p id="value">{count}</p> <button id="inc" onClick={() => setCount(count)}>add</button> </div> ) } const root = ReactDOM.createRoot(document.getElementById("root")) root.render(<App />)
Output ready when you are
Press Run to render your code, or Submit to validate your solution.