frame is used to schedule a function to run on Motion's animation loop. Using Motion's animation loop:
-
Prevents layout thrashing.
-
Provides an easy keep-alive API for creating your own animation loop.
-
Avoids the significant performance overhead of multiple
requestAnimationFramecalls.
Usage
Import frame from Motion:
import { frame }