Skip to content

fix: add container to TypeScript types - #582

Merged
thymikee merged 1 commit into
callstack:masterfrom
jason0x43:update-types-for-container
Oct 28, 2020
Merged

fix: add container to TypeScript types#582
thymikee merged 1 commit into
callstack:masterfrom
jason0x43:update-types-for-container

Conversation

@jason0x43

Copy link
Copy Markdown
Contributor

Summary

Update the TS types for the new container property that was added to the output of render in #567.

Test plan

In a TS project using the current version of @testing-library/react-native (currently 7.1.0), try accessing container on the result of a render call. A typing error will occur because RenderAPI (the result of render) doesn't have a container property.

const bodyText = render(<BodyText>Foo</BodyText>);
expect(bodyText.container).toHaveTextContent('Foo'); // <-- will generate type error

With this PR, no error is shown.

Update the TS types for the new `container` property that was added to
the output of `render` in callstack#567.

@thymikee thymikee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

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

Successfully merging this pull request may close these issues.

2 participants