Fixed types of onRequestClose argument.

This is defined as being native events, but are actually Synthetic events.

See https://github.com/reactjs/react-modal/blob/988f55a277373d119a4c37e7d4cce7e681147326/src/components/ModalPortal.js
This commit is contained in:
Cameron Martin
2019-04-03 11:18:30 +01:00
parent 98ed28785e
commit 39b01c75e7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ declare namespace ReactModal {
onAfterClose?(): void;
/* Function that will be run when the modal is requested to be closed, prior to actually closing. */
onRequestClose?(event: (MouseEvent | KeyboardEvent)): void;
onRequestClose?(event: (React.MouseEvent | React.KeyboardEvent)): void;
/* Number indicating the milliseconds to wait before closing the modal. Defaults to zero (no timeout). */
closeTimeoutMS?: number;
+1 -1
View File
@@ -13,7 +13,7 @@ class ExampleOfUsingReactModal extends React.Component {
render() {
const onAfterOpenFn = () => { };
const onAfterCloseFn = () => { };
const onRequestCloseFn = () => { };
const onRequestCloseFn = (event: React.MouseEvent | React.KeyboardEvent) => { };
const customStyle = {
overlay: {
position: 'fixed',