mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
53 lines
1.0 KiB
TypeScript
53 lines
1.0 KiB
TypeScript
import * as React from 'react';
|
|
import ReactScrollIntoViewIfNeeded from 'react-scroll-into-view-if-needed';
|
|
|
|
const validOptions = {
|
|
block: 'start',
|
|
scrollMode: 'if-needed',
|
|
skipOverflowHiddenElements: true
|
|
};
|
|
|
|
const invalidOptions = {
|
|
invalidOption: 'foobar'
|
|
};
|
|
|
|
() => (
|
|
<ReactScrollIntoViewIfNeeded
|
|
active={true}
|
|
options={{
|
|
block: 'start',
|
|
scrollMode: 'if-needed',
|
|
skipOverflowHiddenElements: true
|
|
}}
|
|
elementType="h1"
|
|
>
|
|
Children
|
|
</ReactScrollIntoViewIfNeeded>
|
|
);
|
|
|
|
() => (
|
|
<ReactScrollIntoViewIfNeeded
|
|
options={{
|
|
invalidOption: 'foobar' // $ExpectError
|
|
}}
|
|
>
|
|
Children
|
|
</ReactScrollIntoViewIfNeeded>
|
|
);
|
|
|
|
() => (
|
|
<ReactScrollIntoViewIfNeeded
|
|
active={5} // $ExpectError
|
|
>
|
|
Children
|
|
</ReactScrollIntoViewIfNeeded>
|
|
);
|
|
|
|
() => (
|
|
<ReactScrollIntoViewIfNeeded
|
|
elementType="h8" // $ExpectError
|
|
>
|
|
Children
|
|
</ReactScrollIntoViewIfNeeded>
|
|
);
|