Repository navigation
Keep the pointerEvents ts-expect-error in emitted spec declarations - #4601
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Summary
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to
|

Description
The three codegen specs redeclare
pointerEventsasWithDefault<..., 'auto'>, which codegen requires.WithDefaultaddsnull, so the interface no longer satisfiesViewProps.pointerEvents, and the source suppresses that with a// @ts-expect-error(or// @ts-ignore) line.Declaration emit drops line comments, so the published
lib/typescript/specs/*.d.tscarry a bare TS2430. Any consumer withskipLibCheck: falsefails to type-check:error TS2430: Interface 'NativeProps' incorrectly extends interface 'ViewProps'. Types of property 'pointerEvents' are incompatible.
This turns the directives into
/** */block comments. TypeScript honours directives in block comments, and JSDoc survives declaration emit, so the suppression now ships with the types. Codegen can't do this itself:extends Omit<ViewProps, 'pointerEvents'>fails with "Unable to handle prop spread: Omit" and droppingWithDefaultfails with "A default enum value is required".Test plan
yarn ts-checkandyarn lint:jsin the packagecombine-js-to-schema-cli, iOS and Android) identical before and afteryarn build, then installed the packed tarball into a fresh RN 0.87 app withskipLibCheck: false: the two RNGH TS2430 errors are gone, only RN's own typing errors remain