File size: 518 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { JSX } from 'react'
import { Valid } from '../types/common'
import { TransitionComponentProps } from '../types'
import { useTransition } from '../hooks'

export function Transition<Item, Props extends TransitionComponentProps<Item>>(
  props:
    | TransitionComponentProps<Item>
    | (Props & Valid<Props, TransitionComponentProps<Item, Props>>)
): JSX.Element

export function Transition({
  items,
  children,
  ...props
}: TransitionComponentProps<any>) {
  return useTransition(items, props)(children)
}