Merge pull request #22252 from peterblazejewicz/fix/react-modal

Fix definition of ReactModal.setAppElement in @types/react-modal
This commit is contained in:
Paul van Brenk
2017-12-27 15:54:18 -08:00
committed by GitHub
2 changed files with 13 additions and 3 deletions
+7 -3
View File
@@ -4,7 +4,8 @@
// Drew Noakes <https://github.com/drewnoakes>,
// Thomas B Homburg <https://github.com/homburg>,
// Tatu Tamminen <https://github.com/ttamminen>,
// Uwe Wiemer <https://github.com/hallowatcher>
// Uwe Wiemer <https://github.com/hallowatcher>,
// Peter Blazejewicz <https://github.com/peterblazejewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
@@ -97,6 +98,9 @@ declare namespace ReactModal {
declare class ReactModal extends React.Component<ReactModal.Props> {
/* 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;
}
+6
View File
@@ -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 = () => { };