chenglou / react-tween-state

React animation.
Other
1.74k stars 70 forks source link

Default export is missing #39

Closed danieljuhl closed 9 years ago

danieljuhl commented 9 years ago

I seems as there is no export default ... causing the module to be empty.

I had to explicit pick the Mixin (import { Mixin as tweenStateMixin } from 'react-tween-state') instead of loading the full module (import tweenState from 'react-tween-state')

chenglou commented 9 years ago

Right, Mixin isn't the default export: https://github.com/chenglou/react-tween-state/blob/d4b498a7b5654bcf495872de0608c2357e726c7c/examples/example1.jsx#L3

I do this for a reason. I was predicting that a better API is coming so I wanted to reserve the default export for something else. I'll be posting it tonight =)

mathieumg commented 9 years ago

I'll be posting it tonight =)

It's as though you had a talk soon! :wink: :metal:

danieljuhl commented 9 years ago

I understand - but I didn't ask for the mixin to be exported as default, but the whole module... then we would be able to tweenState.Mixin as stated in the documentation.

chenglou commented 9 years ago

I'm not sure I understand here. What's wrong with import * as tweenState from 'tween-state' and using tweenState.Mixin like that?

danieljuhl commented 9 years ago

There is nothing wrong :) I just wondered why you'd choosen to have no default export, as it can lead to some confusions. But as I wrote, I understand, if you have plans for the default export, which are different and would break the API.

chenglou commented 9 years ago

Actually, I've decided to put the new API into its own library since it has little to do with tween-state now. As such, I've now exposed the default you want =). The * as tweenState* still works too.