1

I would like to use the react-drag-sortable components (https://www.npmjs.com/package/react-drag-sortable) which i successfully installed as follows:

npm install react-drag-sortable

The issue is, my application doesn't recognize when i import this component. Where does this component physically reside after running the npm install command? How can I then use it in my application?

This is not about installing packages (Where does npm install packages?)

DannyMoshe
  • 6,023
  • 4
  • 31
  • 53

1 Answers1

1

It's in node-modules/react-drag-sortable/lib/index.js

It's exported with the following line at the end of the file:

exports.default = DragSortableList;
kev
  • 1,011
  • 8
  • 15
  • 1
    I just found this myself, but i'll accept your answer since it is correct. Thanks – DannyMoshe Jan 15 '19 at 17:39
  • By any chance do you know where the dependencies should be placed for this component to function properly? For instance 'Interactjs' is required but not sure where that package should be located. – DannyMoshe Jan 15 '19 at 17:41
  • 1
    I haven't used this component, so take my suggestions with a grain of salt. In the index.js file, all the dependencies for drag-sortable are imported. This one with the line `var _interactjs = require('interactjs');` So when you import the drag-sortable, it should work out of the box. The dependencies are all in your node-modules folder. This one, for instance, in a folder named `interactjs`. You shouldn't have to import them all manually, unless something is wrong. – kev Jan 15 '19 at 17:48