Posted on 2026-10-23
The digits are large and scale with screen width, so they never wrap on a phone.
Fixed-width numerals stop the display from jittering as digits change.
It reads the system clock instead of counting frames, so the time stays correct, even if the tab is throttled or in the background.
The theme is saved in localStorage, and a small script in index.html applies it before the page paints, so there’s no flash of the wrong theme on reload.
Posted on 2026-10-18
loadBooks is passed to useState() as a function, so it runs only once on startup instead of on every render.
The useEffect() in App saves the list to localStorage whenever books changes.
Stars and Book are small components that receive data and callbacks as props. State lives in App, and the children just call onUpdate or onDelete.
updateBook and deleteBook never modify the array in place. They create a new one with .map() and .filter(), which is what React needs to notice a change.