Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translateChoice warning in ReferenceField #4738

Merged
merged 1 commit into from
Apr 30, 2020

Conversation

JulienMattiussi
Copy link
Contributor

Issue

A warning is displayed about the boolean type of translateChoice prop in a ReferenceField.
But it's not an error, this type can be func or bool.

image

To reproduce

Use nested ReferenceField in a list view.

<List {...props} >
    <Datagrid>
      <DateField source="created_at" />
      <ReferenceField
        label="region_name"
        source="customer_id"
        reference="customers"
        link={false}
      >
        <ReferenceField
          source="customer_region_id"
          reference="customer_regions"
        >
          <TextField source="name" />
        </ReferenceField>
      </ReferenceField>
    </Datagrid>
  </List>

Solution

The type of translateChoice can be func or bool in PropTypes

@JulienMattiussi JulienMattiussi added the RFR Ready For Review label Apr 30, 2020
@Luwangel Luwangel merged commit 2ed109b into master Apr 30, 2020
@Luwangel Luwangel deleted the translateChoix-referencefield branch April 30, 2020 11:37
@Luwangel Luwangel added this to the 3.4.4 milestone Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants