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

TypeError: Cannot read properties of undefined (reading 'add') #862

Open
ujwaldeepsc20y opened this issue Oct 28, 2022 · 1 comment
Open

Comments

@ujwaldeepsc20y
Copy link

Not sure why this error is coming up while using SortableElement. Here is the code snippet I am using

const DragHandle = SortableHandle(() => <span>::</span>);
const DraggableContainer = SortableContainer(({ children }) => {
  return <ul>{children}</ul>;
});
const DraggableElement = SortableElement(({ value }) => (
  <li value={value}>
    <DragHandle />
    {value}
  </li>
));

and here is how I am using the above components in render

render() {
   return (
       <DraggableContainer
         useDragHandle
         // getContainer={this.getContainer}
         // helperContainer={this.getHelperContainer}
         // onSortEnd={this.handleSortEnd}
       >
         <DraggableElement key={`item-1`} index={0} value={1} />
         <DraggableElement key={`item-2`} index={1} value={2} />
       </DraggableContainer>
   );
 }
@Raviteja7714
Copy link

Raviteja7714 commented Apr 2, 2024

Facing the same issue after upgrading to react 18..
Uncaught TypeError: this.context.manager.add is not a function
image

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