From b713bd031bd9022e95e01a061380163edeb036d8 Mon Sep 17 00:00:00 2001 From: Cody Marshall Johnston Date: Mon, 14 Mar 2016 10:22:55 -0700 Subject: [PATCH] Update README.md to include testing gotchas --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index b1aedd6f..6e869811 100644 --- a/README.md +++ b/README.md @@ -123,6 +123,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. # Demos * http://reactjs.github.io/react-modal/