Skip to main content
100%

useState

✓ Published1🌍 Public
RRichard Burd
Last edited Jan 30, 2022
Created on Jan 29, 2022
Forked from HTML Starter

A React counter demonstrates the `useState` hook for managing numeric state, with buttons that increment and decrement a displayed number. The code uses functional updates to avoid stale closures and shows how initial state can be provided either directly or lazily via a function, logging console messages to illustrate when each initialization runs. Rendering uses `ReactDOM.render` into a root div, with the interface styled by large CSS font sizes.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes