Skip to content

Remove propTypes statics that break typings with @types/react@19 - #5973

Merged
Eugene (OEvgeny) merged 3 commits into
mainfrom
OEvgeny/fix-react-19-prop-types-typings
Oct 29, 2026
Merged

Eugene (OEvgeny) merged 3 commits into
mainfrom
OEvgeny/fix-react-19-prop-types-typings

Conversation

@OEvgeny

@OEvgeny Eugene (OEvgeny) commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

Related to #5552: with @types/react@19 and skipLibCheck: false, TypeScript fails on Web Chat's declarations with TS7016 for prop-types.

Changelog Entry

Removed

  • 💥 Function components: removed ReactWebChat.propTypes and Composer.propTypes, fixing type errors with @types/react@19, related to #5552, in PR #5973, by @OEvgeny

Description

The propTypes of the exported Composer, ReactWebChat and FullComposer made the declarations import prop-types, whose types @types/react@19 no longer installs. They are removed, like their defaultProps in #5956.

No new test: a consumer type check on @types/react 16, 18 and 19 now has no TS7016 and no new errors.

Design

  • Inner components keep their propTypes with the same props; adding @types/prop-types to dependencies would also work, but adds a dependency for types React 19 ignores.

Specific Changes

  • api Composer, component Composer and ReactWebChat, bundle FullComposer: removed propTypes
  • bundle FullComposer: children prop is readonly
  • I have added tests and executed them locally
  • I have added .changelog/<PR#>-<slug>.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

Eugene Olonov added 2 commits October 28, 2026 14:15
The propTypes statics of the exported function components made the emitted
.d.ts import 'prop-types'. @types/react@19 no longer depends on
@types/prop-types, so consumers with skipLibCheck: false got TS7016.

Their inner components (ComposerCore, ComposerWithStore) keep their propTypes
and receive the same props; className and role are validated by BasicWebChat.
React 19 ignores propTypes.

Part of #5552

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@OEvgeny
Eugene (OEvgeny) merged commit d857205 into main Oct 29, 2026
58 of 61 checks passed
@OEvgeny
Eugene (OEvgeny) deleted the OEvgeny/fix-react-19-prop-types-typings branch October 29, 2026 00:12
Eugene (OEvgeny) pushed a commit that referenced this pull request Oct 29, 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.

3 participants