davidkpiano / flipping

Flipping awesome animations.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 export
  • import * as Flipping from 'flipping'
    → module resolves to a non-module entity and cannot be imported using this construct
  • import 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!