fix: export HeaderProps type from react-aria-components#9613
Merged
reidbarber merged 1 commit intoadobe:mainfrom Feb 6, 2026
Merged
fix: export HeaderProps type from react-aria-components#9613reidbarber merged 1 commit intoadobe:mainfrom
reidbarber merged 1 commit intoadobe:mainfrom
Conversation
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
Author
|
fwiw my workaround is just to manually type my exported header like |
Contributor
Author
|
In fact, |
snowystinger
approved these changes
Feb 5, 2026
reidbarber
approved these changes
Feb 6, 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.
Summary
HeaderPropstype from the mainindex.tsentry pointProblem
When wrapping the
Headercomponent (e.g., with a styling library), TypeScript needs to infer and emit the type in declaration files. For example:TypeScript tries to express something like:
But
HeaderPropsis defined internally in react-aria-components without being exported from the package entry point:This produces the error:
Why It Worked Before
Previously,
HeaderPropsextended onlyHTMLAttributes<HTMLElement>- a built-in type from@types/reactthat's universally available. TypeScript could inline or reference these portable types without needing to nameHeaderPropsitself.In 1.15.0,
HeaderPropsnow extendsDOMRenderProps<'header', undefined>- a type internal to react-aria-components. TypeScript can't express the component's props without referencingHeaderProps, but sinceHeaderPropsisn't exported, it can't be named in declaration files.Why It Matters for Libraries
Libraries that emit declaration files require all exported types to be nameable - TypeScript needs to be able to write valid type references that consumers can resolve. When a type depends on an unexported internal type from a dependency, TypeScript throws
TS4023.