Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/5973-fix-react-19-prop-types-typings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Removed

- 💥 Function components: removed `ReactWebChat.propTypes` and `Composer.propTypes`, fixing type errors with `@types/react@19`, related to [#5552](https://github.com/microsoft/BotFramework-WebChat/issues/5552), in PR [#5973](https://github.com/microsoft/BotFramework-WebChat/pull/5973), by [@OEvgeny](https://github.com/OEvgeny)
7 changes: 0 additions & 7 deletions packages/api/src/hooks/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -857,13 +857,6 @@ const Composer = ({ internalRenderErrorBox, onTelemetry, ponyfill, styleOptions,
);
};

Composer.propTypes = {
...ComposerWithStore.propTypes,
internalRenderErrorBox: PropTypes.any,
onTelemetry: PropTypes.func,
ponyfill: PropTypes.any
};

export default Composer;

export type { ComposerProps };
10 changes: 1 addition & 9 deletions packages/bundle/src/FullComposer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Components, type ComposerProps } from 'botframework-webchat-component';
import PropTypes from 'prop-types';
import React from 'react';
import AddFullBundle, { type AddFullBundleProps, type AddFullBundleChildren } from './AddFullBundle';

Expand All @@ -13,7 +12,7 @@ type ComposerPropsChildren = ComposerProps['children'];
* The union type of ComposerProps and AddFullBundleProps was not resolving correctly, so manually constructing the type here.
*/
type FullComposerProps = Omit<BaseFullComposerProps, 'children'> & {
children?: ComposerPropsChildren | AddFullBundleChildren;
readonly children?: ComposerPropsChildren | AddFullBundleChildren | undefined;
};

const FullComposer = (props: FullComposerProps) => (
Expand All @@ -28,13 +27,6 @@ const FullComposer = (props: FullComposerProps) => (
</AddFullBundle>
);

FullComposer.propTypes = {
...Composer.propTypes,
adaptiveCardsHostConfig: PropTypes.any,
adaptiveCardsPackage: PropTypes.any,
children: PropTypes.any
};

export default FullComposer;

export type { FullComposerProps };
6 changes: 0 additions & 6 deletions packages/component/src/Composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,5 @@ const Composer = ({
);
};

Composer.propTypes = {
...APIComposer.propTypes,
...ComposerCore.propTypes,
children: PropTypes.any
};

export default Composer;
export type { ComposerProps };
13 changes: 0 additions & 13 deletions packages/component/src/ReactWebChat.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import PropTypes from 'prop-types';
import React from 'react';

import BasicWebChat from './BasicWebChat';
Expand All @@ -25,18 +24,6 @@ const ReactWebChat = ({ className, role, ...composerProps }: ReactWebChatProps)
</Composer>
);

const {
// Excluding "children" from ComposerProps.
children: _,
...composerPropTypesWithoutChildren
} = Composer.propTypes;

ReactWebChat.propTypes = {
className: PropTypes.string,
role: PropTypes.string,
...composerPropTypesWithoutChildren
};

export default ReactWebChat;

export type { ReactWebChatProps };
Loading