reactjs/react-modal

View on GitHub
docs/examples/on_request_close.md

Summary

Maintainability
Test Coverage
# onRequestClose Callback

This example shows how you can use the `onRequestClose` prop with a function to perform actions when closing.

This is especially important for handling closing the modal via the escape key.

Also more important if `shouldCloseOnOverlayClick` is set to `true`, when clicked on overlay it calls `onRequestClose`.

[onRequestClose example](https://codepen.io/claydiffrient/pen/KNjVBx)