Skip to content

Conversation

@trappar
Copy link
Contributor

@trappar trappar commented Feb 1, 2024

What: Fixes: #1271

Why: To improve typescript types

How: N/A

Checklist:

  • Documentation added to the
    docs site N/A
  • Tests
  • TypeScript definitions updated
  • Ready to be merged

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 1, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 0c2672e:

Sandbox Source
React Configuration
react-testing-library-examples Configuration

@eps1lon eps1lon changed the title Update types to support all possible react component return values fix: Update types to support all possible react component return values Feb 1, 2024
Copy link
Member

@eps1lon eps1lon left a comment

Choose a reason for hiding this comment

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

Thanks!

@eps1lon eps1lon merged commit 55e79c2 into testing-library:main Feb 1, 2024
@eps1lon
Copy link
Member

eps1lon commented Feb 1, 2024

@all-contributors add @trappar for code

@allcontributors
Copy link
Contributor

@eps1lon

I've put up a pull request to add @trappar! 🎉

@trappar trappar deleted the types-reactnode branch February 1, 2024 19:53
@Akallabet
Copy link

Akallabet commented Feb 2, 2024

@eps1lon
After updating to the latest version of react testing library, I am seeing TS failures unfortunately

Type 'JSXElementConstructor<{ children: ReactElement<any, string | JSXElementConstructor<any>>; }>' is not  assignable to type 'JSXElementConstructor<{ children: ReactNode; }> | undefined'.

Changing ReactElement to ReactNode seems like a breaking change, any help?

@stephannielsen
Copy link

We see failures with this message now:

Type '({ children }: { children: JSX.Element; }) => JSX.Element' is not assignable to type 'JSXElementConstructor<{ children: ReactNode; }> | undefined'.

@asso1985
Copy link

asso1985 commented Feb 2, 2024

Missing breaking change? Broke our tests.

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.

Render function's typescript type excludes valid react component types

5 participants