react/packages/react-noop-renderer
Andrew Clark 268a3f60df
Add unstable APIs for async rendering to test renderer (#12478)
These are based on the ReactNoop renderer, which we use to test React
itself. This gives library authors (Relay, Apollo, Redux, et al.) a way
to test their components for async compatibility.

- Pass `unstable_isAsync` to `TestRenderer.create` to create an async
renderer instance. This causes updates to be lazily flushed.
- `renderer.unstable_yield` tells React to yield execution after the
currently rendering component.
- `renderer.unstable_flushAll` flushes all pending async work, and
returns an array of yielded values.
- `renderer.unstable_flushThrough` receives an array of expected values,
begins rendering, and stops once those values have been yielded. It
returns the array of values that are actually yielded. The user should
assert that they are equal.

Although we've used this pattern successfully in our own tests, I'm not
sure if these are the final APIs we'll make public.
2018-03-28 14:57:25 -07:00
..
npm Run 90% of tests on compiled bundles (both development and production) (#11633) 2017-11-23 17:44:58 +00:00
src Add unstable APIs for async rendering to test renderer (#12478) 2018-03-28 14:57:25 -07:00
README.md Add Fiber Debugger (#8033) 2016-10-25 08:36:37 +01:00
index.js Remove vars (#11766) 2017-12-05 13:47:57 +00:00
package.json Updating dependencies for react-noop-renderer 2018-03-27 19:07:53 -07:00

README.md

react-noop-renderer

This package is the renderer we use for debugging Fiber. It is not intended to be used directly.