Capítulo 79 de 142

Chapter 79: propEffect

Core Idea

Learn to use Motion's propEffect to dynamically apply motion values to JavaScript object properties. Understand how it facilitates re-rendering on updates, its utility for libraries like Three.js, and how to apply and clean up effects.

Key Concepts

  • Cancel: propEffect returns a cleanup function which
  • Animate faster with Motion+.: Unlock 430+ premium examples

Code Examples

const pos = { x: 0, y: 0, z: 0 }
const x = motionValue(0)

propEffect(pos, { x })

// Set x on pos to 100
x.set(100)

// Animate x on pos to 200
animate(x, 200)
  • What it demonstrates: Core usage pattern for propEffect.

Key Takeaways

  1. propEffect supports Cancel.
  2. propEffect supports Animate faster with Motion+..

Connects To

  • motionValue: related Motion doc page.
  • frame: related Motion doc page.
  • styleEffect: related Motion doc page.
  • attrEffect: related Motion doc page.
  • svgEffect: related Motion doc page.