How to use the react-native-redash.bin function in react-native-redash

To help you get started, we’ve selected a few react-native-redash examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wcandillon / can-it-be-done-in-react-native / the-5-min / src / Accordion / AnimationHelpers.ts View on Github external
export const useTransition = <
  T extends typeof withSpringTransition | typeof withTimingTransition
>(
  state: boolean,
  config: Parameters[1],
  withTransition: T
) => {
  const value = useMemoOne(() => new Value(0), []);
  useCode(set(value, bin(state)), [state]);
  const transition = useMemoOne(() => withTransition(value, config), []);
  return transition;
};
github wcandillon / can-it-be-done-in-react-native / the-5-min / src / Accordion / List.tsx View on Github external
export default ({ list }: ListProps) => {
  const [open, setOpen] = useState(false);
  const transition = useTransition(
    open,
    not(bin(open)),
    bin(open),
    400,
    Easing.inOut(Easing.ease)
  );
  const height = bInterpolate(
    transition,
    0,
    LIST_ITEM_HEIGHT * list.items.length
  );
  const bottomRadius = interpolate(transition, {
    inputRange: [0, 16 / 400],
    outputRange: [8, 0]
  });
  return (
    <>
       setOpen(prev => !prev)}>
github wcandillon / can-it-be-done-in-react-native / the-5-min / src / Accordion / List.tsx View on Github external
export default ({ list }: ListProps) => {
  const [open, setOpen] = useState(false);
  const transition = useTransition(
    open,
    not(bin(open)),
    bin(open),
    400,
    Easing.inOut(Easing.ease)
  );
  const height = bInterpolate(
    transition,
    0,
    LIST_ITEM_HEIGHT * list.items.length
  );
  const bottomRadius = interpolate(transition, {
    inputRange: [0, 16 / 400],
    outputRange: [8, 0]
  });
  return (
    <>
       setOpen(prev => !prev)}>