@atlaskit/motion
Version:
A set of utilities to apply motion in your application.
16 lines (15 loc) • 887 B
TypeScript
import { type CallbackRef } from '../utils/use-element-ref';
import type { ResizingOpts } from './use-resizing';
/**
* `useResizing` animates dimension changes (width, height, or both) over state changes.
* If the relevant dimension(s) haven't changed nothing will happen.
*
* Pass `dimension: 'width' | 'height' | 'both'` to choose which axis (or axes) to animate.
*
* __WARNING__: Potentially janky. This hook animates layout-affecting properties which are
* [notoriously unperformant](https://firefox-source-docs.mozilla.org/performance/bestpractices.html#Get_familiar_with_the_pipeline_that_gets_pixels_to_the_screen).
* Test your app over low powered devices, you may want to avoid this if you can see it impacting FPS.
*/
export declare const useLegacyResizing: ({ dimension, duration, easing, onFinishMotion, onStartMotion, }: ResizingOpts) => {
ref: CallbackRef;
};