I am getting TypeError: Cannot read property 'ownerDocument' of null even if all the required props are passed to Container and element.
Line Number: 429
File: SortableContainer/index.js
I'm going through the same thing. It happens when I try to iterate with a .map function the items that are in my initial state.
Yep same issue here
You have to wrap your items with an element;
error;
indexes.map((index: number) => (
<div key={`${name}-${index}`}>
...
</div>
))
Fix;
<div>
{indexes.map((index: number) => (
<div key={`${name}-${index}`}>
...
</div>
))}
</div>
Would be nice if React.Fragment could be used for this purpose.
One other thing to look out for - if you wrap an element whose render exits early and returns undefined/null when there are no items you'll also get this error.
Most helpful comment
You have to wrap your items with an element;
error;
Fix;