nhunzaker / react-animatable

http://www.natehunzaker.com/react-animatable/
5 stars 1 forks source link

Adding a few code comments #3

Open jefffriesen opened 10 years ago

jefffriesen commented 10 years ago

@nhunzaker Overall the code is fairly straightforward, but there is still some mystery. Also, this seems like it's breaking new ground a bit with animations for React. I was only aware of animating through css via ReactCSSTransitionGroup.

I think a few comments for the code would really help out. Things like tick(), updateSnapshot(), invariant could be good candidates.

Also what happens if componentDidMount() is used in the same component where this mixin is included, is that a problem (I realize that may be more of a react question but I haven't come across it yet if it is)

nhunzaker commented 10 years ago

It's a very good idea. Fortunately, the life cycle methods defined in React mixins are non-destructive; they layer on under the component they are used in. This is actually one of my favorite parts of react.