chenglou / react-tween-state

React animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Default export is missing

danieljuhl opened this issue · comments

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')

Right, Mixin isn't the default export:

import * as tweenState from '../';

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 =)

I'll be posting it tonight =)

It's as though you had a talk soon! 😉 🤘

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.

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

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.

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.