🌍 Public
Viewing a saved revision (read-only)
d7b41541bde24bb1b3277491e1b65406
React Starter
A minimal React starter demonstrates the difference between a current state value and the value rendered one frame earlier. The application uses React’s `useState` to hold an initial count of 20, and `useRef` combined with `useEffect` to store the previous count after each render. It displays both numbers in an `h1` element. The example loads React and ReactDOM from unpkg CDN, renders via `ReactDOM.render`, and tracks the previous value by updating a ref inside a side-effecting hook, showing a simple state-update pattern without external data.
AI-generated descriptionReact Starter code.