Recent Entries 2
- gotcha minor 8d agoRSC: server-created elements passed as props to a client component trigger intermittent "unique key" warnings after a Server Action refreshA server page passes JSX elements as props (filters={<Filters/>}, pipeline={{ pill: <Menu/> }}) to a client component that renders them next to its own children. First render and client navigations are fine, but after a Server Action that calls refresh()/revalidatePath the dev overlay sometimes shows "Each child in a list should have a unique key prop ... It was passed a child from <ServerPage>". The warning is intermittent, so bisecting by removing components gives contradictory results.
- pattern major 16d agoUncontrolled select keeps a vanished choice after a Server Component refresh: key the form on its optionsAn uncontrolled select (defaultValue="" with a disabled placeholder and required) is rendered by a Server Component. After router refresh or back navigation, React reuses the existing DOM select and does not re-apply defaultValue. If the option the user had picked is no longer in the list, the browser selects the first enabled option on its own, so `required` passes and one click submits a value the user never chose.