react-sortable-hoc
react-sortable-hoc copied to clipboard
Uncaught TypeError: cannot call a class as a function
When I change code, and the app re-renders, it always crashes with this error message:
Uncaught TypeError: cannot call a class as a function
I'm not sure why it's happening.
Basically, this is what I have...
const SortableCont = SortableContainer(({ children }: any) => <div>{children}</div>);
const SortableItem = SortableElement((props: any) => <ButtonTypeVariations {...props} />);
return (
....
<SortableCont
onSortOver={sortActionButtonList}
lockToContainerEdges={true}
axis="y"
lockAxis="y"
lockOffset={['5%', '5%']}
useDragHandle={true}
>
{actionButtonList.map((value: any, index: number) =>
<SortableItem key={`item-${index}`} index={index} value={{ ...value, index }} />
)}
</SortableCont>
)}
bump