What you were expecting:
I'm using an ArrayField component:
https://github.com/MTSWebServices/data-rentgen-ui/blob/099f72030c2ba108f05a3312060eddc8b24a2c09/src/components/dataset/DatasetRaList.tsx
<List resource="datasets">
<DatagridConfigurable bulkActionButtons={false}>
<TextField
source="data.name"
label="resources.datasets.fields.name"
sortable={false}
/>
<ArrayField
source="data.tags"
label="resources.datasets.fields.tags"
>
<SomeComponent />
</ArrayField>
</DatagridConfigurable>
</List>
It compiled properly on 5.14.4, but started to fail after upgrading to 5.14.5
What happened instead:
https://github.com/MTSWebServices/data-rentgen-ui/actions/runs/24035103336/job/70092613450?pr=152
Error: src/components/dataset/DatasetRaList.tsx(40,21): error TS2322: Type '{ children: Element; source: "data.tags"; label: string; }' is not assignable to type 'IntrinsicAttributes & ArrayFieldBaseProps<{ "data.tags": any; } & { data: any; } & { "data.tags": any; } & { "data.tags": any; } & { "data.tags": any; } & { data: any; }>'.
Property 'label' does not exist on type 'IntrinsicAttributes & ArrayFieldBaseProps<{ "data.tags": any; } & { data: any; } & { "data.tags": any; } & { "data.tags": any; } & { "data.tags": any; } & { data: any; }>'.
This is because #11191 switched from:
const ArrayFieldImpl(props: ArrayFieldProps) => { ... };
export const ArrayField = genericMemo(ArrayFieldeImpl);
export interface ArrayFieldProps extends FieldProps;
to
const ArrayFieldBaseImpl(props: ArrayFieldBaseProps) => { ... };
export const ArrayFieldBase = genericMemo(ArrayFieldeBaseImpl);
export interface ArrayFieldBaseProps extends FieldBaseProps;
export const ArrayField = ArrayFieldBase;
FieldProps do have label property, but FieldBaseProps doesn't.
Steps to reproduce:
Related code:
- Preferably, a sandbox forked from
- A link to a GitHub repo with the minimal codebase to reproduce the issue
insert short code snippets here
Other information:
Environment
- React-admin version: 5.14.5
- Last version that did not exhibit the issue (if applicable): 5.14.4
- React version: 19.2.4
- Browser: NodeJS
- Stack trace (in case of a JS error): see above
What you were expecting:
I'm using an
ArrayFieldcomponent:https://github.com/MTSWebServices/data-rentgen-ui/blob/099f72030c2ba108f05a3312060eddc8b24a2c09/src/components/dataset/DatasetRaList.tsx
It compiled properly on 5.14.4, but started to fail after upgrading to 5.14.5
What happened instead:
https://github.com/MTSWebServices/data-rentgen-ui/actions/runs/24035103336/job/70092613450?pr=152
This is because #11191 switched from:
to
FieldPropsdo havelabelproperty, butFieldBasePropsdoesn't.Steps to reproduce:
Related code:
https://codesandbox.io/p/github/marmelab/react-admin-sandbox/main (v5)
https://stackblitz.com/github/marmelab/react-admin/tree/master/examples/simple (v5)
https://stackblitz.com/github/marmelab/react-admin/tree/4.x/examples/simple (v4)
Other information:
Environment