Hacker News new | ask | show | jobs
by Izkata 4 hours ago
The "Form data" section is doing two completely different things, the large one is two different implementations of a React component mixed together while the short one doesn't store "data" anywhere for use later like the React one does.

Edit: Similar with the "UI components" section, the long one is missing the UI while the short one is UI without the trigger to activate it. You'd probably combine the two, using state from the first to control the UI in the second (replacing the contents of the useEffect with the dialog API to get the modal effect).