How do i import this into a typescript code-base?
codepunkt opened this issue · comments
I'm working on a react app written in typescript, based on create-react-app
with react-scripts-ts
.
Trying to import this library, i failed miserably.
import Flipping from 'flipping'
→ module has no default exportimport * as Flipping from 'flipping'
→ module resolves to a non-module entity and cannot be imported using this constructimport Flippin = require('flipping')
→ import assignment cannot be used when targeting ECMAScript modules
I would really like to test this library, but i'm rather new to typescript and really struggling with this. What can i do - preferrably without changing my typescript settings?
My tsconfig.json
settings are
{
"module": "esnext",
"target": "es5"
}
Try setting allowSyntheticDefaultImports
to true
.
@davidkpiano I know this is rather out of scope for this project. Couldn't find any information on this whatsoever yesterday, so this helps a lot. Thanks!