Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: cannot call a class as a function #847

Open
kongjeey opened this issue Jul 12, 2022 · 1 comment
Open

Uncaught TypeError: cannot call a class as a function #847

kongjeey opened this issue Jul 12, 2022 · 1 comment

Comments

@kongjeey
Copy link

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

@mateBe95
Copy link

bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants