Skip to content

Commit 230a4c5

Browse files
committed
Merge pull request reduxjs#1464 from igorsantos07/patch-1
setState + shallow rendering are now working fine
2 parents 06ac006 + 4ca239f commit 230a4c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/recipes/WritingTests.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,9 +337,9 @@ describe('components', () => {
337337
})
338338
```
339339

340-
#### Fixing Broken `setState()`
340+
#### Fixing Broken `setState()` in older React versions
341341

342-
Shallow rendering currently [throws an error if `setState` is called](https://github.com/facebook/react/issues/4019). React seems to expect that, if you use `setState`, the DOM is available. To work around the issue, we use jsdom so React doesn’t throw the exception when the DOM isn’t available. Here’s how to [set it up](https://github.com/facebook/react/issues/5046#issuecomment-146222515):
342+
In React <= 0.13, 0.14.4 and 0.14.5, Shallow rendering [used to throw an error if `setState` is called](https://github.com/facebook/react/issues/4019). React seems to expect that, if you use `setState`, the DOM is available. To work around the issue, we use jsdom so React doesn’t throw the exception when the DOM isn’t available. Here’s how to [set it up](https://github.com/facebook/react/issues/5046#issuecomment-146222515):
343343

344344
```
345345
npm install --save-dev jsdom

0 commit comments

Comments
 (0)