Skip to content

Commit

Permalink
feat: add ListTransition, close #7
Browse files Browse the repository at this point in the history
  • Loading branch information
iamyoki committed Dec 30, 2021
1 parent 1289cff commit e5f77b1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/ListTransition/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import React from 'react';
import {Stage, useListTransition} from '..';

type ListTransitionProps<Item> = {
list: Array<Item>;
timeout: number;
children: (item: Item, stage: Stage) => React.ReactNode;
};

export function ListTransition<Item>({
list,
timeout,
children,
}: ListTransitionProps<Item>) {
const transition = useListTransition(list, timeout);

return transition(children);
}

0 comments on commit e5f77b1

Please sign in to comment.