atlassian / react-beautiful-dnd

Beautiful and accessible drag and drop for lists with React
https://react-beautiful-dnd.netlify.app
Other
33.4k stars 2.58k forks source link

Please update egghead.io tutorial for ref versus innerRef #1911

Open westofpluto opened 4 years ago

westofpluto commented 4 years ago

Hello Nice library but please update your tutorial on egghead.io. That code uses:

innerRef={provided.innerRef}

which is incorrect. My code matched your code exactly and the items would not drag. After lots of searching around, I stumbled across the solution:

ref={provided.innerRef}

It does not seem to matter whether the component is styled or not - the variable to set is called ref.

danieldelcore commented 3 years ago

Just adding a link to the ref docs for future reference

https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/using-inner-ref.md