mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user