Skip to content

Commit 4d25543

Browse files
authored
Merge pull request #9132 from marmelab/fix-ts-error-stories-FC
[TypeScript] Fix TS errors with `<ArrayField>` and `<ChipField>` in stories
2 parents 3677cba + 7b2b300 commit 4d25543

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

packages/ra-ui-materialui/src/field/ArrayField.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export const ArrayField = genericMemo(ArrayFieldImpl);
100100
export interface ArrayFieldProps<
101101
RecordType extends Record<string, unknown> = Record<string, any>
102102
> extends FieldProps<RecordType> {
103-
children: ReactNode;
103+
children?: ReactNode;
104104
perPage?: number;
105105
sort?: SortPayload;
106106
filter?: FilterPayload;

packages/ra-ui-materialui/src/field/ChipField.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export const ChipField = genericMemo(ChipFieldImpl);
5454
export interface ChipFieldProps<
5555
RecordType extends Record<string, unknown> = Record<string, any>
5656
> extends FieldProps<RecordType>,
57-
Omit<ChipProps, 'label'> {}
57+
Omit<ChipProps, 'label' | 'children'> {
58+
/**
59+
* @internal do not use (prop required for TS to be able to cast ChipField as FunctionComponent)
60+
*/
61+
children?: React.ReactNode;
62+
}
5863

5964
const PREFIX = 'RaChipField';
6065

0 commit comments

Comments
 (0)