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

[@testing-library/react_v9.x.x] refactor: Clean up the types #3713

Merged

Conversation

valscion
Copy link
Contributor

Other notes:

Following up from #3705, this PR cleans up the existing @testing-library/react_v9.x.x types so that there are less confusing parts.

At any point of this PR, this is ready to be merged. When reviewers have time, I will be happy to get this PR merged and then can continue future work on these types in another PR ☺️

This also removes the same unused import from all react-testing-library
versions (the previous name of the library).

This unused import seems to have been there from the beginning:
14a28a0
|} & Queries;
declare type RenderResultWithCustomQueries<CustomQueries> = {
...CustomQueries,
declare type RenderResult<Queries = GetsAndQueries> = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Now this type is no longer exact (as I can't think of a way to specify that Queries could be exact). Maybe this is still better than having two different types for the render result as we did after #3705.

Copy link
Member

Choose a reason for hiding this comment

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

Not 100% sure that spreading inexact objects is a good thing, but definitely better than an intersection on an exact one :) Plus less type duplication. Let's try.

@pascalduez pascalduez merged commit 0b0eb4a into flow-typed:master Feb 1, 2020
@valscion valscion deleted the clean-up-testing-library-react-types branch February 3, 2020 08:12
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.

None yet

2 participants