Browse Source

Document test renderer act (temporary fix)

main
Dan Abramov 6 years ago
committed by GitHub
parent
commit
d20be53455
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      content/docs/addons-test-utils.md

4
content/docs/addons-test-utils.md

@ -46,6 +46,10 @@ var ReactTestUtils = require('react-dom/test-utils'); // ES5 with npm
To prepare a component for assertions, wrap the code rendering it and performing updates inside an `act()` call. This makes your test run closer to how React works in the browser.
>Note
>
>If you use `react-test-renderer`, it also provides an `act` export that behaves the same way.
For example, let's say we have this `Counter` component:
```js

Loading…
Cancel
Save