@madeja-studio/telar
Version:
UI component library by Madeja Studio
20 lines (16 loc) • 441 B
text/typescript
import { to as rsto } from '@react-spring/native';
import type { AnimationFactory } from './animation';
interface PushProps {
from?: number;
to?: number;
}
export const push: AnimationFactory<PushProps, { translationY: number }> = ({
from = 0,
to = 1,
} = {}) => ({
from: { translationY: from },
style: (values) => ({
transform: [{ translateY: rsto(values.translationY, (t) => t) }],
}),
to: { translationY: to },
});