diff --git a/types/react-modal/index.d.ts b/types/react-modal/index.d.ts index 715f4c3b01..16ee347cfd 100644 --- a/types/react-modal/index.d.ts +++ b/types/react-modal/index.d.ts @@ -4,7 +4,8 @@ // Drew Noakes , // Thomas B Homburg , // Tatu Tamminen , -// Uwe Wiemer +// Uwe Wiemer , +// Peter Blazejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -97,6 +98,9 @@ declare namespace ReactModal { declare class ReactModal extends React.Component { /* Override base styles for all instances of this component. */ static defaultStyles: ReactModal.Styles; - /* Call this to properly hide your application from assistive screenreaders and other assistive technologies while the modal is open. */ - static setAppElement(appElement: HTMLElement): void; + /** + * Call this to properly hide your application from assistive screenreaders + * and other assistive technologies while the modal is open. + */ + static setAppElement(appElement: string | HTMLElement): void; } diff --git a/types/react-modal/react-modal-tests.tsx b/types/react-modal/react-modal-tests.tsx index 8ce91bf15f..76958adbb3 100644 --- a/types/react-modal/react-modal-tests.tsx +++ b/types/react-modal/react-modal-tests.tsx @@ -1,6 +1,12 @@ import * as React from "react"; import ReactModal = require('react-modal'); +// tests for static method +// string +ReactModal.setAppElement("#main"); +// HTMLElement +ReactModal.setAppElement(document.getElementById("#main")); + class ExampleOfUsingReactModal extends React.Component { render() { const onAfterOpenFn = () => { };