Skip to content

Commit 94b232d

Browse files
Slashgearclaude
andcommitted
fix: adapt inView callback to motion v12 API
The inView callback now receives an IntersectionObserverEntry instead of a plain object with a target property. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 812c4de commit 94b232d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

modules/home/Number.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export const Number = ({ value, text }: { value: number; text: string }) => {
2626

2727
useEffect(() => {
2828
if (elementRef.current) {
29-
inView(elementRef.current, ({ target }) => {
30-
animate(target, { opacity: 1 }, { delay: 0.2, easing: 'ease-out' });
29+
inView(elementRef.current, (entry) => {
30+
animate(entry.target, { opacity: 1 }, { delay: 0.2, easing: 'ease-out' });
3131
if (counterRef.current) {
3232
counter(counterRef.current, Math.floor(value * 0.6), value);
3333
}

0 commit comments

Comments
 (0)