Skip to content

[bug] Multidrag is not a constructor #141

Closed

Description

@trollcus

Hi!

Been using the latest version and everything works smoothy. However when I try to enable mulltidrag I get thrown an error saying that MultiDrag is not a constructor:
image

React sortablejs version: "^2.0.11",

The code I'm running:


import { ReactSortable, Sortable, MultiDrag } from 'react-sortablejs';

Sortable.mount(new MultiDrag());


My app is built upon NextJS with the version : "^9.3.2"

What can I do in order to enable multidrag without the error?

Activity

  1. changed the title [-][bug] [/-] [+]Multidrag is not a constructor [bug] [/+] on Apr 20, 2020
  2. waynevanson commented on Apr 20, 2020

    @waynevanson
    Collaborator

    Perhaps a webpack bug of some sort. The code does export MultiDrag.

    I don't think I can help right now, as it looks like you've done everything correctly. I'll take a look in the next few days again and see what I come up with.

  3. waynevanson commented on Apr 23, 2020

    @waynevanson
    Collaborator

    @trollcus If you can get me a working example repo/codesandbox I can investigate. Refer to #143 for more information.

  4. changed the title [-]Multidrag is not a constructor [bug] [/-] [+][bug] Multidrag is not a constructor[/+] on Apr 23, 2020
  5. smatt989 commented on May 20, 2020

    @smatt989

    Any update here? have the same issue!

  6. trollcus commented on May 29, 2020

    @trollcus
    Author

    @waynevanson Hmm I'll try to get it set up. Unfortunately it is an private repo but I'll try to get it reproduced!

  7. trollcus commented on Jun 4, 2020

    @trollcus
    Author

    @waynevanson @smatt989 Solved it by strategically placing the mount function at a place that I knew would only be kicked off once in my application when rendering the list components instead at the component level where it would be kicked off multiple times. Don't know if that is the proper way but works for me 👍

  8. waynevanson commented on Sep 27, 2020

    @waynevanson
    Collaborator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions