import { JSX } from 'react' import { NoInfer, UnknownProps } from '@react-spring/types' import { useSpring, UseSpringProps } from '../hooks/useSpring' import { SpringValues, SpringToFn, SpringChain } from '../types' export type SpringComponentProps = unknown & UseSpringProps & { children: (values: SpringValues) => React.JSX.Element | null } // Infer state from "from" object prop. export function Spring( props: { from: State to?: SpringChain> | SpringToFn> } & Omit>, 'from' | 'to'> ): JSX.Element | null // Infer state from "to" object prop. export function Spring( props: { to: State } & Omit>, 'to'> ): JSX.Element | null export function Spring({ children, ...props }: any) { return children(useSpring(props)) }