Skip to content

fix: extract TypeScript props from mixin class bases - #1157

Merged
danez merged 4 commits into
8.xfrom
fix/pr-1145-mixin-props-8x
Oct 31, 2026
Merged

danez merged 4 commits into
8.xfrom
fix/pr-1145-mixin-props-8x

Conversation

@danez

@danez danez commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

Class components extending a mixin call such as withFoo(React.Component<Props>) currently omit their TypeScript props. This extracts the base component's props so their types, required flags, and descriptions appear in the documentation.

Preserves @mfazekas's original contribution from #1145, including the original commit authorship, and adds three separate fixes:

  • Keep wrapped props such as React.PropsWithChildren<Props> on the shared unwrapping path.
  • Only infer props from React Component and PureComponent bases; retain declared props for unrelated generic arguments.
  • Read both Babel 7 and Babel 8 type-argument fields.

Targets the maintained 8.x line and includes a patch changeset. Supersedes #1145, whose organization-owned source fork does not permit the maintainer push needed to add these fixes.

Validation: library and CLI builds, lint, all 1,494 library tests on Babel 7, all 1,491 applicable library tests on Babel 8 (three Babel 7-only cases skipped), all 57 CLI tests on both Babel versions, and strict consumer declaration checks with both versions.

@changeset-bot

changeset-bot Bot commented Oct 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 365a2ce

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
react-docgen Patch
@react-docgen/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@danez
danez merged commit 18c902b into 8.x Oct 31, 2026
20 checks passed
@danez
danez deleted the fix/pr-1145-mixin-props-8x branch October 31, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants