Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Typescript Issue with React when instantiating new Shuffle #214
Steps to reproduce
Here is my component code:
What is Expected?
An error is does not occur in the componentDidMount.
What is actually happening?
"TypeError: WEBPACK_IMPORTED_MODULE_2_shufflejs is not a constructor" occurs on the line where
Thanks for the quick response! I placed the console statement here:
Hi, I don't think this ticket is resolved yet.
// index.d.ts // line 6, currently: export = Shuffle; // should be: export default Shuffle;
If this were a commonjs module,
// es6 module import Shuffle from 'shufflejs' // commonjs module import * as Shuffle from 'shufflejs'
But this is an es6 module, so there is a 'default' member and the definition should reflect that.
I hope that helps! No snark intended, just want to be thorough :)