diff --git a/INTHEWILD.md b/INTHEWILD.md index 49e8e7aa2..a1707717e 100644 --- a/INTHEWILD.md +++ b/INTHEWILD.md @@ -7,6 +7,7 @@ Organizations - [Product Hunt](https://github.com/producthunt) - [Walmart Labs](https://github.com/walmartlabs) - [Hudl](http://hudl.github.io/) + - [NET-A-PORTER](https://github.com/NET-A-PORTER) Projects ---------- diff --git a/docs/api/ShallowWrapper/contains.md b/docs/api/ShallowWrapper/contains.md index c2e7295e3..74b7c6bb6 100644 --- a/docs/api/ShallowWrapper/contains.md +++ b/docs/api/ShallowWrapper/contains.md @@ -1,6 +1,6 @@ # `.contains(nodeOrNodes) => Boolean` -Returns whether or not the current wrapper has a node anywhere in it's render tree that looks like +Returns whether or not the current wrapper has a node anywhere in its render tree that looks like the one passed in. @@ -13,7 +13,7 @@ render tree. #### Returns -`Boolean`: whether or not the current wrapper has a node anywhere in it's render tree that looks +`Boolean`: whether or not the current wrapper has a node anywhere in its render tree that looks like the one passed in. diff --git a/src/ReactWrapperComponent.jsx b/src/ReactWrapperComponent.jsx index bbe80a355..3cb191557 100644 --- a/src/ReactWrapperComponent.jsx +++ b/src/ReactWrapperComponent.jsx @@ -54,7 +54,7 @@ export default function createWrapperComponent(node, options = {}) { const component = this._reactInternalInstance._renderedComponent; const inst = component.getPublicInstance(); if (inst === null) { - return component; + return component._instance; } return inst; }, diff --git a/test/ReactWrapper-spec.js b/test/ReactWrapper-spec.js index 9febd1ff2..e69459f3b 100644 --- a/test/ReactWrapper-spec.js +++ b/test/ReactWrapper-spec.js @@ -113,6 +113,15 @@ describeWithDOM('mount', () => { expect(wrapper.find('.qoo').text()).to.equal('qux'); }); + it('supports findDOMNode with stateless components', () => { + const Foo = ({ foo }) => ( +
{foo}
+ ); + + const wrapper = mount(); + expect(wrapper.text()).to.equal('qux'); + }); + it('works with nested stateless', () => { const TestItem = () => (
1