Skip to content

Commit

Permalink
[chore] improvements on readme testing section.
Browse files Browse the repository at this point in the history
  • Loading branch information
diasbruno committed Jun 25, 2017
1 parent c2f582f commit bb69a91
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ ReactDOM.render(<App />, 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 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.

```xml
<Modal
isOpen={bool}
Expand Down

0 comments on commit bb69a91

Please sign in to comment.