bendc / animateplus

A+ animation module for the modern web
MIT License
5.96k stars 280 forks source link

Cannot call function as a class #38

Closed aulneau closed 6 years ago

aulneau commented 6 years ago

Hi there!

I'm very excited to try this out, but I've been trying to import the library in my react project and I cannot get it working unfortunately.

I keep getting the error TypeError: Cannot call a class as a function.

I'm importing as : import animate from 'lib/animateplus'

Any help would be much appreciated!

Best

pqt commented 6 years ago

Try

import animate from "~lib/animateplus";

though looking in package.json I'm inclined to suggest one of the following two options

import animate from "~animateplus";
import animate from "animateplus";

I don't work with react specifically and stuff changes depending on your build process; I'm sure we can get it working regardless! Update me if none of these options work.

aulneau commented 6 years ago

Thanks for your reply! I don't believe the import is not the issue (I have aliases / a module resolver babel plugin) , I think the issue is coming from the way its exported and then the way Im using the export as a function.

bendc commented 6 years ago

Hi! Closing the issue as this is related to your tooling/setup, not to this library specifically.