Open
Description
Describe the bug
Once i install react-sortablejs node module with react app and then proceed with dependency works, I had caught with below mentioned issue
To Reproduce
Steps to reproduce the behavior:
- Run
npm i react-sortablejs
- Run you react app with
npm run start
- After importing the required dependencies
- See error "Uncaught TypeError: _reactSortablejs.MultiDrag is not a constructor" in your console
Expected behavior
Once i import the dependencies for react-sortablejs in a class component it should be working as expected
Information
Below i attached the code block for your reference
import section
import { ReactSortable, Sortable, MultiDrag, Swap } from "react-sortablejs";
After import dependency, but before starting class component
Sortable.mount(new MultiDrag(), new Swap());
Within render method
<ReactSortable
multiDrag // enables mutidrag
// OR
swap // enables swap
>
{qrFormat.map((item, index) => (
<div key={index}>{item}</div>
))}
</ReactSortable>
Browser Information
browser = Chrome Version 81.0.4044.113 (Official Build) (64-bit) / Firefox Version 75.0 (64-bit)
Versions - Look in your package.json
for this information:
react-sortable = 2.0.11
react = ^16.10.2
Additional context
This was the first i tried using react-sortablejs and it is throwing me these type of errors