File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,12 @@ import * as React_2 from 'react';
20
20
21
21
// @public @deprecated (undocumented)
22
22
export const Card: React_2 .FunctionComponent <ICardProps > & {
23
- Item: React_2 .FunctionComponent <ICardItemProps >;
24
- Section: React_2 .FunctionComponent <ICardSectionProps >;
23
+ Item: React_2 .FunctionComponent <React_2 . PropsWithChildren < ICardItemProps > >;
24
+ Section: React_2 .FunctionComponent <React_2 . PropsWithChildren < ICardSectionProps > >;
25
25
};
26
26
27
27
// @public @deprecated (undocumented)
28
- export const CardItem: React_2 .FunctionComponent <ICardItemProps >;
28
+ export const CardItem: React_2 .FunctionComponent <React_2 . PropsWithChildren < ICardItemProps > >;
29
29
30
30
// @public @deprecated (undocumented)
31
31
export const CardSection: React_2 .FunctionComponent <ICardSectionProps >;
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ const CardStatics = {
18
18
* future.
19
19
*/
20
20
export const Card : React . FunctionComponent < ICardProps > & {
21
- Item : React . FunctionComponent < ICardItemProps > ;
22
- Section : React . FunctionComponent < ICardSectionProps > ;
21
+ Item : React . FunctionComponent < React . PropsWithChildren < ICardItemProps > > ;
22
+ Section : React . FunctionComponent < React . PropsWithChildren < ICardSectionProps > > ;
23
23
} = createComponent ( CardView , {
24
24
displayName : 'Card' ,
25
25
styles,
Original file line number Diff line number Diff line change @@ -117,14 +117,14 @@ function _isReactElement(item: React.ReactNode): item is React.ReactElement {
117
117
return ! ! item && typeof item === 'object' && ! ! ( item as React . ReactElement ) . type ;
118
118
}
119
119
120
- function _isCardItem ( item : React . ReactNode ) : item is typeof CardItem {
120
+ function _isCardItem ( item : React . ReactNode ) {
121
121
// In theory, we should be able to just check item.type === CardItem.
122
122
// However, under certain unclear circumstances (see https://github.com/microsoft/fluentui/issues/10785),
123
123
// the object identity is different despite the function implementation being the same.
124
124
// CardItem is generated by createComponent, so we need to check its displayName instead of name
125
125
return _isReactElement ( item ) && ( item . type as React . ComponentType ) . displayName === CardItem . displayName ;
126
126
}
127
127
128
- function _isCardSection ( item : React . ReactNode ) : item is typeof CardSection {
128
+ function _isCardSection ( item : React . ReactNode ) {
129
129
return _isReactElement ( item ) && ( item . type as React . ComponentType ) . displayName === CardSection . displayName ;
130
130
}
Original file line number Diff line number Diff line change @@ -8,11 +8,14 @@ import { CardItemView } from './CardItem.view';
8
8
* @deprecated This component was experimental and is no longer being developed on, nor will it be supported in the
9
9
* future.
10
10
*/
11
- export const CardItem : React . FunctionComponent < ICardItemProps > = createComponent ( CardItemView , {
12
- displayName : 'CardItem' ,
13
- styles,
14
- tokens,
15
- } ) ;
11
+ export const CardItem : React . FunctionComponent < React . PropsWithChildren < ICardItemProps > > = createComponent (
12
+ CardItemView ,
13
+ {
14
+ displayName : 'CardItem' ,
15
+ styles,
16
+ tokens,
17
+ } ,
18
+ ) ;
16
19
17
20
/**
18
21
* @deprecated This component was experimental and is no longer being developed on, nor will it be supported in the
You can’t perform that action at this time.
0 commit comments