Skip to content

Commit

Permalink
Minor updates to findDOMNode, as per additional post-commit CR feedback.
Browse files Browse the repository at this point in the history
  • Loading branch information
jimfb committed Jan 5, 2015
1 parent ebf4cb4 commit f507ba3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/browser/__tests__/findDOMNode.-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ describe('findDOMNode', function() {

it('findDOMNode should reject unmounted objects with render func', function() {
expect(function() {React.findDOMNode({render: function(){}});})
.toThrow('Invariant Violation: Component contains `render` ' +
'method but is not mounted in the DOM'
.toThrow('Invariant Violation: Component (with keys: render) ' +
'contains `render` method but is not mounted in the DOM'
);
});

Expand Down
8 changes: 4 additions & 4 deletions src/browser/findDOMNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
*/

"use strict";

var ReactComponent = require('ReactComponent');
var ReactInstanceMap = require('ReactInstanceMap');
var ReactMount = require('ReactMount');

Expand All @@ -36,8 +34,10 @@ function findDOMNode(componentOrElement) {
return ReactMount.getNodeFromInstance(componentOrElement);
}
invariant(
!(componentOrElement.render != null && typeof(componentOrElement.render) === 'function'),
'Component contains `render` method but is not mounted in the DOM',
componentOrElement.render == null ||
typeof(componentOrElement.render) !== 'function',
'Component (with keys: %s) contains `render` method '
+'but is not mounted in the DOM',
Object.keys(componentOrElement)
);
invariant(
Expand Down

0 comments on commit f507ba3

Please sign in to comment.