The stored double never follows the count.
Acceptance criteria
- 1.Adding should show 8.
The stored double never follows the count.
function App() { const [count, setCount] = React.useState(3) const [doubled] = React.useState(6) return ( <div> <p id="double">{doubled}</p> <button id="inc" onClick={() => setCount(count + 1)}>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.