Add type definition for saveHashHistory option on Links (#46879)

This commit is contained in:
Aditya Mansharamani 2020-08-21 00:36:39 -05:00 committed by GitHub
parent 74fcf0e889
commit c2859fdc14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -1,4 +1,4 @@
// Type definitions for react-scroll 1.5
// Type definitions for react-scroll 1.8
// Project: https://github.com/fisshy/react-scroll
// Definitions by: Ioannis Kokkinidis <https://github.com/sudoplz>
// Giedrius Grabauskas <https://github.com/GiedriusGrabauskas>

View File

@ -16,6 +16,7 @@ export interface ReactScrollLinkProps {
onSetActive?(to: string): void;
onSetInactive?(): void;
ignoreCancelEvents?: boolean;
saveHashHistory?: boolean;
}
export type LinkProps = ReactScrollLinkProps & React.HTMLProps<HTMLButtonElement>;

View File

@ -110,6 +110,17 @@ const linkTest5 = (
</Link>
);
const linkTest6 = (
<Link
to="target"
saveHashHistory={true}
spy={true}
hashSpy={true}
>
Test 7 (hash history)
</Link>
);
const options = {} as any;
animateScroll.scrollToTop(options);
animateScroll.scrollToBottom(options);