Skip to content

v0.7.3

Compare
Choose a tag to compare
@nandorojo nandorojo released this 30 Mar 14:49
· 418 commits to master since this release

0.7.3 (2021-03-30)

New Features

useDynamicAnimation

New hook that lets you use style objects dynamically, rather than using static variants.

const animation = useDynamicAnimation(() => {
  return {
    height: 100
  }
})

const onLayout = ({ nativeEvent }) => {
  animation.animateTo({
    ...animation.current,
    height: nativeEvent.layout.height
  })
}

return <MotiView state={animation} />

Benefits

  • High performance
  • Zero re-renders
  • Animations run on the native thread
  • Easy API

Imports

  • You can now import MotiView, MotiText without an alias.
    • import { MotiView } from 'moti'
    • This is a non-breaking change. You can still import { View as MotiView } from 'moti'
      • However, this may be deprecated in the future.

Bug Fixes

  • Skeleton fixed on web out of the box! (see tweet)
  • Animate Presence now works with multiple style props, closing #41