react-sortable-hoc icon indicating copy to clipboard operation
react-sortable-hoc copied to clipboard

Uncaught TypeError: cannot call a class as a function

Open kongjeey opened this issue 2 years ago • 1 comments

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>
    )}

Screen Shot 2022-07-12 at 3 10 11 AM

kongjeey avatar Jul 12 '22 07:07 kongjeey

bump

mateBe95 avatar Oct 26 '22 11:10 mateBe95