react-testing-library icon indicating copy to clipboard operation
react-testing-library copied to clipboard

fix: Update 'onCaughtError' type inference in 'RenderOptions' to work with React v19

Open aicest opened this issue 6 months ago • 3 comments

What: To fix incorrect onCaughtError type inference in RenderOptions.

Repro: https://codesandbox.io/p/devbox/delicate-voice-7wnf7z?file=%2Ftest%2Frender.test-d.ts%3A6%2C5-6%2C28

Screenshot 2025-05-28 at 23 40 10

Why: As explained above.

How: Update TS types.

Checklist:

  • [ ] Documentation added to the docs site
  • [ ] Tests - React v18 types: No impact - React v19 types: Fixed
  • [x] TypeScript definitions updated
  • [ ] Ready to be merged

aicest avatar May 28 '25 16:05 aicest

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 f68378eb928379ed3c9abeb44fc4b35be07f716e:

Sandbox Source
react-testing-library-examples Configuration

codesandbox-ci[bot] avatar May 28 '25 16:05 codesandbox-ci[bot]

Type checking failed.

image

Solution: https://github.com/fb55/entities/pull/1851

Workaround: Set skipLibCheck in tsconfig.json to true

aicest avatar May 28 '25 17:05 aicest

Typechecking is failing now.

eps1lon avatar May 30 '25 09:05 eps1lon