Skip to content

Commit 702c832

Browse files
committed
Merge pull request #5 from SmaatoUI/bug/patch-0.0.3
Fix minor bug with 0.0.3 release and add notes to README.
2 parents 1627f7b + 51ad432 commit 702c832

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ it('references the mocked state object', (done) => {
156156
Use this factory to test React components' state by passing in various props,
157157
inspecting their DOM, and simulating user interactions.
158158

159+
**WARNING:** Methods for finding child Components won't work unless the root
160+
component is a _composite Component_ (e.g. a Component you've defined), not a
161+
_native Component_ (e.g. div or table). This seems related to
162+
[this React issue](https://github.com/facebook/react/issues/1533#issuecomment-52243372).
163+
159164
```javascript
160165
// Construction via factory methods:
161166
it('accepts a ReactElement and returns a TestCase instance', () => {

src/TestCaseFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function createFromElement(reactElement) {
5252
}
5353

5454
// Disallow elements created from stateless functional components.
55-
if (!reactElement.type.prototype.render) {
55+
if (reactElement.type.prototype && !reactElement.type.prototype.render) {
5656
throw new Error('createFromElement expects an instance of a React Class (i.e. a class with a render method) but no render method was found.');
5757
}
5858

0 commit comments

Comments
 (0)