Skip to content

Commit 7d23477

Browse files
committed
Revert "Fix typings for FullChatComposer (#5580)"
This reverts commit 0f28670.
1 parent e48fbd9 commit 7d23477

File tree

5 files changed

+5
-78
lines changed

5 files changed

+5
-78
lines changed

CHANGELOG.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,6 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/
308308
- Fixed aria-label only announcing placeholder in feedback form, in PR [#5567](https://github.com/microsoft/BotFramework-WebChat/pull/5567)
309309
- Fixed placing focus on the code block content, so it is possible to scroll code via keyboard, in PR [#5575](https://github.com/microsoft/BotFramework-WebChat/pull/5575), by [@OEvgeny](https://github.com/OEvgeny)
310310
- Fixed [#5581](https://github.com/microsoft/BotFramework-WebChat/issues/5581). Activities should be displayed after upgrading via `npm install`, in PR [#5582](https://github.com/microsoft/BotFramework-WebChat/pull/5582), by [@compulim](https://github.com/compulim)
311-
- Fixed Composer props types not resolving correctly in React 16 in PR [#5580](https://github.com/microsoft/BotFramework-WebChat/pull/5580),
312-
by [@lexi-taylor](https://github.com/lexi-taylor)
313311

314312
### Removed
315313

packages/bundle/src/AddFullBundle.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@ import { type AdaptiveCardsPackage } from './types/AdaptiveCardsPackage';
1414
import { type StrictFullBundleStyleOptions } from './types/FullBundleStyleOptions';
1515
import useComposerProps from './useComposerProps';
1616

17-
type AddFullBundleChildren = ({ extraStyleSet }: { extraStyleSet: any }) => ReactNode;
18-
1917
type AddFullBundleProps = Readonly<{
2018
adaptiveCardsHostConfig?: any;
2119
adaptiveCardsPackage?: AdaptiveCardsPackage;
2220
attachmentForScreenReaderMiddleware?: OneOrMany<AttachmentForScreenReaderMiddleware>;
2321
attachmentMiddleware?: OneOrMany<AttachmentMiddleware>;
24-
children: AddFullBundleChildren;
22+
children: ({ extraStyleSet }: { extraStyleSet: any }) => ReactNode;
2523
htmlContentTransformMiddleware?: HTMLContentTransformMiddleware[];
2624
renderMarkdown?: (
2725
markdown: string,
@@ -76,4 +74,4 @@ function AddFullBundle({
7674

7775
export default memo(AddFullBundle);
7876

79-
export type { AddFullBundleProps, AddFullBundleChildren };
77+
export type { AddFullBundleProps };

packages/bundle/src/FullComposer.tsx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
import { Components, type ComposerProps } from 'botframework-webchat-component';
22
import PropTypes from 'prop-types';
33
import React from 'react';
4-
import AddFullBundle, { type AddFullBundleProps, type AddFullBundleChildren } from './AddFullBundle';
54

6-
const { Composer } = Components;
7-
8-
type BaseFullComposerProps = ComposerProps & AddFullBundleProps;
5+
import AddFullBundle, { type AddFullBundleProps } from './AddFullBundle';
96

10-
type ComposerPropsChildren = ComposerProps['children'];
7+
const { Composer } = Components;
118

12-
/* The props of FullComposer are the union of Composer and AddFullBundle, except "children".
13-
* The union type of ComposerProps and AddFullBundleProps was not resolving correctly, so manually constructing the type here.
14-
*/
15-
type FullComposerProps = Omit<BaseFullComposerProps, 'children'> & {
16-
children?: ComposerPropsChildren | AddFullBundleChildren;
17-
};
9+
type FullComposerProps = ComposerProps & AddFullBundleProps;
1810

1911
const FullComposer = (props: FullComposerProps) => (
2012
<AddFullBundle {...props}>

packages/bundle/test-d/fail-once/full-composer-props-children-invalid.test-d.tsx

Lines changed: 0 additions & 9 deletions
This file was deleted.

packages/bundle/test-d/pass/full-composer-props-children.test-d.tsx

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)