mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix an argument name of TestUtils.renderIntoDocument (#8104)
This commit is contained in:
committed by
Dan Abramov
parent
7bcad0a6aa
commit
d49dfe7da4
@@ -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:
|
||||
>
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user