Fix an argument name of TestUtils.renderIntoDocument (#8104)

This commit is contained in:
Toru Kobayashi
2016-10-26 13:44:46 +01:00
committed by Dan Abramov
parent 7bcad0a6aa
commit d49dfe7da4
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -122,10 +122,10 @@ ReactTestUtils.Simulate.keyDown(node, {key: "Enter", keyCode: 13, which: 13});
### `renderIntoDocument()`
```javascript
renderIntoDocument(instance)
renderIntoDocument(element)
```
Render a component into a detached DOM node in the document. **This function requires a DOM.**
Render a React element into a detached DOM node in the document. **This function requires a DOM.**
> Note:
>
+2 -2
View File
@@ -77,14 +77,14 @@ function findAllInRenderedTreeInternal(inst, test) {
* @lends ReactTestUtils
*/
var ReactTestUtils = {
renderIntoDocument: function(instance) {
renderIntoDocument: function(element) {
var div = document.createElement('div');
// None of our tests actually require attaching the container to the
// DOM, and doing so creates a mess that we rely on test isolation to
// clean up, so we're going to stop honoring the name of this method
// (and probably rename it eventually) if no problems arise.
// document.documentElement.appendChild(div);
return ReactDOM.render(instance, div);
return ReactDOM.render(element, div);
},
isElement: function(element) {