Skip to content

fix(types): use type-only imports for strict TypeScript consumers - #771

Merged
gre merged 1 commit into
gre:masterfrom
saseungmin:fix/type-only-imports
Nov 18, 2026
Merged

gre merged 1 commit into
gre:masterfrom
saseungmin:fix/type-only-imports

Conversation

@saseungmin

Copy link
Copy Markdown
Contributor

Summary

Fix TS1484 errors for React Native consumers using verbatimModuleSyntax: true.

With the react-native export condition enabled, TypeScript resolves this package to src/index.tsx and checks the source directly. Four types are currently imported as values, causing consumer type checks to fail.

  • Mark ReactNode, StyleProp, ViewStyle, and LayoutChangeEvent as type-only imports.
  • Add a patch changeset.

Verification

Using existing consumer dependencies (TypeScript 6.0.3 and React Native 0.88.1):

  • Reproduced four TS1484 errors before the fix.
  • Confirmed the same consumer fixture passes after the fix with customConditions: ["react-native"] and verbatimModuleSyntax: true.
  • Confirmed identical JavaScript output before and after the change using Babel’s TypeScript preset.
  • ESLint, Prettier, and git diff --check passed.

Reference

React Native consumers resolve the published TSX source through the
react-native export condition. Mark the four type imports explicitly so
verbatimModuleSyntax consumers can type-check that source without errors.
Include a patch changeset and preserve the generated JavaScript.

Constraint: Consumers can resolve src/index.tsx instead of declaration files
Confidence: high
Scope-risk: narrow
Tested: Consumer TypeScript 6.0.3 with react-native condition and verbatimModuleSyntax; ESLint; Prettier; identical Babel JavaScript output
Not-tested: Full Jest suite and native builds; locked dependency download returned npm 404
@gre
gre merged commit fe6412a into gre:master Nov 18, 2026
10 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
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.

2 participants