lifenautjoe / droppable

A javascript library to give file dropping super-powers to any HTML element.
https://lifenautjoe.github.io/droppable
MIT License
204 stars 13 forks source link

Cannot use 'new' with an expression whose type lacks a call or construct signature #24

Closed famu1hundred closed 6 years ago

famu1hundred commented 6 years ago

import * as Droppable from 'droppable'; this.droppable = new Droppable({ element: document.querySelector('#droppable-area'), acceptsMultipleFiles: false });

This produces the following error: Cannot use 'new' with an expression whose type lacks a call or construct signature.

lifenautjoe commented 6 years ago

Hey there @famu1hundred ,

The library has a default export.

Try import Droppable from 'droppable'; please.

famu1hundred commented 6 years ago

Actually I got it to work using the following import * as Droppable from 'droppable'; this.droppable = new Droppable.default({ element: document.getElementById('droppable-area'), acceptsMultipleFiles: false });

famu1hundred commented 6 years ago

I also tried your import and it worked as well!