mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add onAfterClose prop to ReactModal
This commit is contained in:
parent
34b631c678
commit
305151cf2d
5
types/react-modal/index.d.ts
vendored
5
types/react-modal/index.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for react-modal 3.6
|
||||
// Type definitions for react-modal 3.8.1
|
||||
// Project: https://github.com/reactjs/react-modal
|
||||
// Definitions by: Rajab Shakirov <https://github.com/radziksh>,
|
||||
// Drew Noakes <https://github.com/drewnoakes>,
|
||||
@ -64,6 +64,9 @@ declare namespace ReactModal {
|
||||
/* Function that will be run after the modal has opened. */
|
||||
onAfterOpen?(): void;
|
||||
|
||||
/* Function that will be run after the modal has closed. */
|
||||
onAfterClose?(): void;
|
||||
|
||||
/* Function that will be run when the modal is requested to be closed, prior to actually closing. */
|
||||
onRequestClose?(event: (MouseEvent | KeyboardEvent)): void;
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ class ExampleOfUsingReactModal extends React.Component {
|
||||
overlayRef: HTMLDivElement;
|
||||
render() {
|
||||
const onAfterOpenFn = () => { };
|
||||
const onAfterCloseFn = () => { };
|
||||
const onRequestCloseFn = () => { };
|
||||
const customStyle = {
|
||||
overlay: {
|
||||
@ -59,6 +60,7 @@ class ExampleOfUsingReactModal extends React.Component {
|
||||
<ReactModal
|
||||
isOpen={true}
|
||||
onAfterOpen={onAfterOpenFn}
|
||||
onAfterClose={onAfterCloseFn}
|
||||
onRequestClose={onRequestCloseFn}
|
||||
contentLabel="demo label"
|
||||
closeTimeoutMS={1000}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user