Skip to content
Cheng Lou edited this page May 23, 2016 · 13 revisions

Upgrading from 0.3.* to 0.4.0

Thanks for upgrading!

Before checking the list of changes, this visualization might be enough.

  • spring() now has its signature changed from spring(value, [stiffness, damping]) to spring(value, {stiffness: ..., damping: ..., precision: ...}). If you used e.g. spring(10, presets.gentle), this stays the same (presets has been changed to use objects instead so no refactoring needed).

  • Motion's style now only takes values intended to be interpolated. Previously it allowed you to pass {x: spring(0), y: 'randomUnrelatedStuffHere'}. This is now disallowed. Simply pass them to the component you're styling in your children function.

  • Same applies for StaggeredMotion and TransitionMotion. The latter is a bit tricky, since you might have wanted to carry around the extra data of the unmounted style configuration. Fortunately, TransitionMotion's whole API got a revamp and made this use-case cleaner. See the README for more info.

  • The TransitionMotion API changes from using styles object to styles array, thus making reorderKeys unnecessary. It's now removed.

  • Subtle change: strengthened the defaultStyle/defaultStyles/willEnter format. No longer allowed to pass spring() configs in these since these are starting values and the configs only applied to destination values (style/styles/willLeave).

  • React-Native build is now gone since RN v0.18+ uses the vanilla NPM React.

  • Miscellaneous perf improvements, type friendliness, bug fixes.