diff --git a/examples/visualization/src/app/react-dom/FadeIn/page.tsx b/examples/visualization/src/app/react-dom/FadeIn/page.tsx index aeecb96e4..5eef570dc 100644 --- a/examples/visualization/src/app/react-dom/FadeIn/page.tsx +++ b/examples/visualization/src/app/react-dom/FadeIn/page.tsx @@ -39,7 +39,7 @@ export default function Page() { key={userId} clientOnly fallback={ - + {skeleton} } diff --git a/packages/react-dom/src/FadeIn.tsx b/packages/react-dom/src/FadeIn.tsx index 010dd3531..cb09f7c9f 100644 --- a/packages/react-dom/src/FadeIn.tsx +++ b/packages/react-dom/src/FadeIn.tsx @@ -1,5 +1,5 @@ import { type CSSProperties, type ComponentPropsWithoutRef, type ElementType } from 'react' -import { useInView } from './useInView' +import { type InViewOptions, useInView } from './useInView' type FadeInProps = ComponentPropsWithoutRef & { /** @@ -18,6 +18,7 @@ type FadeInProps = ComponentPropsWithoutRef & { * The timing function of the animation. */ timingFunction?: CSSProperties['animationTimingFunction'] + inViewOptions?: InViewOptions } export function FadeIn({ @@ -25,10 +26,11 @@ export function FadeIn({ delay = 0, duration = 200, timingFunction = 'linear', + inViewOptions, ...rest }: FadeInProps) { const Component = as ?? 'div' - const { inView, ref } = useInView() + const { inView, ref } = useInView(inViewOptions) return (