Skip to content

Commit f20fb62

Browse files
authored
[react-dom] Types for FragmentInstance#experimental_scrollIntoView (DefinitelyTyped#73554)
1 parent d254fc5 commit f20fb62

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

types/react-dom/experimental.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ declare module "react" {
7272
listener: EventListener,
7373
optionsOrUseCapture?: Parameters<Element["removeEventListener"]>[2],
7474
): void;
75+
experimental_scrollIntoView(alignToTop?: boolean): void;
7576
}
7677
}
7778

types/react-dom/test/experimental-tests.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,14 @@ function fragmentRefTest() {
105105
// @ts-expect-error -- Not the same options as addEventListener
106106
passive: true,
107107
});
108+
instance.experimental_scrollIntoView(false);
109+
instance.experimental_scrollIntoView(true);
110+
instance.experimental_scrollIntoView(undefined);
111+
112+
instance.experimental_scrollIntoView(
113+
// @ts-expect-error -- options are not supported yet
114+
{}
115+
);
108116
return () => {};
109117
}}
110118
>

0 commit comments

Comments
 (0)