Skip to content

Add TestRenderer.act callback function #528

Open
@macintoshhelper

Description

@macintoshhelper

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions