Transitions

Transitions can attach an animation value to a change of React state.

State (JS Thread)

Value (UI Thread)

Timing

useTimingTransition()

withTimingTransition()

Spring

useSpringTransition()

withSpringTransition()

import { useTiming } from "react-native-redash";

const Toggle = () => {
  const [open, setOpen] = useState(false);
  const transition = useTiming(open, { duration: 400 });
}

useTiming()

const useTiming: (state: number | boolean, config?: Animated.WithTimingConfig) => number;

useSpring()

const useSpring: (state: number | boolean, config?: Animated.WithSpringConfig) => number;

Last updated