From 8148667c6ddbab2bf5a8f141f085332908d03569 Mon Sep 17 00:00:00 2001 From: Edvin Erikson Date: Sat, 26 Sep 2015 11:16:00 +0200 Subject: [PATCH] Added a note about needing document globally available Added a note in ``10.4-test-utils.md` about needing window, document and document.createElement globally available before importing React. --- docs/10.4-test-utils.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/10.4-test-utils.md b/docs/10.4-test-utils.md index e67c7852b..7ec1aa72f 100644 --- a/docs/10.4-test-utils.md +++ b/docs/10.4-test-utils.md @@ -49,6 +49,11 @@ ReactComponent renderIntoDocument( Render a component into a detached DOM node in the document. **This function requires a DOM.** +> Note: +> +> You will need to have `window`, `window.document` and `window.document.createElement` + globally available **before** you import React. Otherwise React will think it can't access the DOM and methods like `setState` won't work. + ### mockComponent ```javascript