Add TestRenderer.act callback function
Author: macintoshhelperCreated Aug 16, 2021Updated Jul 18, 2026
I am...
| -------------------------------------------------------------------------------------------------
| Requesting a new feature |
|---|
Proposal/Feature-request:
Add callback to render function to run code inside TestRenderer.act function. https://github.com/airbnb/react-sketchapp/blob/b238e69c6f1e65ec6b1d8a908a91fbd9a8cc43a7/src/buildTree.ts#L96-L99
This should allow for Relay data fetching to occur before the component is rendered: https://relay.dev/docs/guides/testing-relay-components/#examples
I’ll work on hacking together a demo for this with a mock GraphQL Relay API; this could be expanded to having a full Relay example in this repo.
Source: airbnb/react-sketchapp