diff --git a/README.md b/README.md index 042f269c..61d082c0 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,11 @@ var App = React.createClass({ ReactDOM.render(, appElement); ``` +# Testing + +When using React Test Utils with this library, here are some things to keep in mind: +- You need to set isOpen={true} on the modal component for it to render its children. +- You need to use the `.portal` property, as in `ReactDOM.findDOMNode(renderedModal.portal)` or `TestUtils.scryRenderedDOMComponentsWithClass(Modal.portal, 'my-modal-class')` to acquire a handle to the inner contents of your modal. By default the modal is closed when clicking outside of it (the overlay area). If you want to prevent this behavior you can pass the 'shouldCloseOnOverlayClick' prop with 'false' value.