Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TestRenderer.act callback function #528

Open
macintoshhelper opened this issue Aug 16, 2021 · 0 comments
Open

Add TestRenderer.act callback function #528

macintoshhelper opened this issue Aug 16, 2021 · 0 comments

Comments

@macintoshhelper
Copy link
Contributor

macintoshhelper commented Aug 16, 2021

I am...

| -------------------------------------------------------------------------------------------------

Requesting a new feature

Proposal/Feature-request:

Add callback to render function to run code inside TestRenderer.act function.

TestRenderer.act(() => {
// synchronous callback
renderer = TestRenderer.create(element);
});

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant