Skip to content

Datagrids are conflicting when the resources use the same id #10382

@fxdave

Description

@fxdave

Image

What you were expecting:
first Datagrid is isolated from the second

What happened instead:
changing the first Datagrid's state changes the second Datagrid's state.

Steps to reproduce:
Have two Datagrid, both should have a row with the same id.

Related code:

export const OrganizationShow = () => (
  <Show>
    <SimpleShowLayout>
      <TextField source="id" />
      <TextField source="name" />
      <NumberField source="customMaxAllowedProperties" />
      <ArrayField source="memberships">
        <Datagrid itemID="asd">
          <TextField source="id" />
          <ReferenceField source="userId" reference="users" />
          <TextField source="role" />
          <ReferenceField source="organizationId" reference="organizations" />
          <DateField source="createdAt" />
          <DateField source="updatedAt" />
        </Datagrid>
      </ArrayField>
      <ReferenceField reference="subscriptions" source="subscription.id" />
      <ArrayField source="portfolios">
        <Datagrid>
          <TextField source="id" />
          <TextField source="name" />
          <ReferenceField source="creatorId" reference="users" />
          <ReferenceField source="organizationId" reference="organizations" />
          <DateField source="createdAt" />
          <DateField source="updatedAt" />
        </Datagrid>
      </ArrayField>
    </SimpleShowLayout>
  </Show>
);

Environment

  • React-admin version: 5.3.4
  • React version: 18.3.1
  • Browser: firefox 132.0.2-1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions