react-dnd / react-dnd

Drag and Drop for React

Home Page:http://react-dnd.github.io/react-dnd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

getNextUniqueId is not compatible with SSR

mkdynamic opened this issue · comments

The global counter state used by getNextUniqueId is not compatible with SSR because the client-side hydration produces a different value, and this value is rendered in at least one spot in the DOM tree (aria-describedby, in the error below):

Warning: Prop `aria-describedby` did not match. Server: "DndDescribedBy-8" Client: "DndDescribedBy-1"

I think switching to useId would solve this problem:
https://react.dev/reference/react/useId

Oops, wrong repo. Meant for dnd-kit :)