Skip to content

Commit

Permalink
Fix React.findDOMNode warning
Browse files Browse the repository at this point in the history
  • Loading branch information
esamattis committed Oct 12, 2015
1 parent 3f90174 commit 84f1372
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/components/connect.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ describe('React', () => {

// setState calls DOM handlers are batched
const container = TestUtils.findRenderedComponentWithType(tree, Container);
const node = React.findDOMNode(container.getWrappedInstance().refs.button);
const node = ReactDOM.findDOMNode(container.getWrappedInstance().refs.button);

This comment has been minimized.

Copy link
@gaearon

gaearon Oct 15, 2015

Contributor

FYI—we didn't actually need to do this.
The correct way to fix this is

const node = container.getWrappedInstance().refs.button;

because in 0.14 DOM refs are DOM nodes.

This comment has been minimized.

Copy link
@esamattis

esamattis Oct 15, 2015

Author Contributor

I know but I didn't want to break 0.13 support with this yet.

This comment has been minimized.

Copy link
@gaearon

gaearon Oct 15, 2015

Contributor

Oh, right. :-)

TestUtils.Simulate.click(node);
expect(childMapStateInvokes).toBe(4);

Expand Down

0 comments on commit 84f1372

Please sign in to comment.