Repository navigation
fix: import the React types the declarations annotate props with - #130
Merged
Merged
Conversation
Since the components moved off `forwardRef`, their props are annotated as
`React.ComponentProps<...>` and the emitted declarations carry that name
unqualified: 47 of the `.d.ts` files in 6.19.0 name `React` without importing
it, so they resolve only for a consumer who happens to have the `@types/react`
UMD global loaded.
A consumer whose React types are a plain module does not. Open Data Capture is
one -- it has no `@types/react` at all (its `react` is a vendored wrapper whose
types never declare a global namespace), so every prop type degraded to `any`
and each handler parameter became an implicit-any error: 26 of them across 12
files on a bump from 6.16.1.
`import type React from 'react'` in each of the 49 source files that names the
type makes the emitted declaration import it too, which resolves the same way
for every consumer. No declaration in `dist` names `React` unqualified now.
Verified against the vendored, module-only React types that exposed this: a
probe calling `<Checkbox onCheckedChange={(checked) => ...} />` fails against
published 6.19.0 with TS7006 and type-checks against this build.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
joshunrau
approved these changes
Oct 30, 2026
|
🎉 This PR is included in version 6.19.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was referenced Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since the components moved off
forwardRef, props are annotated asReact.ComponentProps<…>, and the emitted declarations carry that name unqualified. In 6.19.0, 47.d.tsfiles indistnameReactwithout importing it:That resolves only for a consumer who has
@types/react's UMD global in its program. A consumer whose React types are a plain module does not, and because the failure is inside a.d.tsunderskipLibCheck, nothing reports it — every prop type silently becomesany.Open Data Capture is such a consumer: it has no
@types/reactat all ("@types/react": "-"in its rootpnpm.overrides), and itsreactis a vendored wrapper whose types never declare a global namespace. Bumping it from 6.16.1 to 6.19.0 produced 26 implicit-any errors across 12 files, none of them near a table or anything else that changed:6.16.1 was unaffected:
forwardRefmade the emitted typeimport("react").ForwardRefExoticComponent<…>, an inline import that needs no global.Change
import type React from 'react'in each of the 49 source files that names the type. The emitted declaration then imports it too, which resolves identically for every consumer:No file in
distnamesReactunqualified now (47 → 0). Nothing but imports changed — no component, prop or runtime behaviour is touched.Verification
pnpm lintclean,pnpm test226/226,pnpm buildclean.<Checkbox onCheckedChange={(checked) => …} />fails on published 6.19.0 withTS7006and type-checks against this build. Same tsconfig, same vendored React types, only the libui path differs.Worth a release once merged — Open Data Capture is pinned to 6.16.1 behind a patch until a release carries both this and #129.
🤖 Generated with Claude Code