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

Add label field controller #6745

Merged
merged 1 commit into from
Dec 15, 2021
Merged

Add label field controller #6745

merged 1 commit into from
Dec 15, 2021

Conversation

kevinmamaqi
Copy link
Contributor

It is necessary to have the label parameter to not throw an error on typescript as it is necessary in cases like this:

<ReferenceFieldController
        basePath="/"
        reference="friends"
        resource="/"
        source="friendsId"
        link={false}
        // @ts-ignore <-- needed as typescript throws an error
        label="Family member"
      >
        {({ referenceRecord, ...props }) => {
          return (
            <ReferenceField
              resource="/"
              reference="family"
              source="familyId"
              record={referenceRecord || undefined}
              link={false}
              addLabel={false}
            >
              <TextField source="name" />
            </ReferenceField>
          );
        }}
      </ReferenceFieldController>

It is necessary to have the label parameter to not throw an error on typescript as it is necessary in cases like this:
```
<ReferenceFieldController
        basePath="/"
        reference="friends"
        resource="/"
        source="friendsId"
        link={false}
        // @ts-ignore <-- needed as typescript throws an error
        label="Family member"
      >
        {({ referenceRecord, ...props }) => {
          return (
            <ReferenceField
              resource="/"
              reference="family"
              source="familyId"
              record={referenceRecord || undefined}
              link={false}
              addLabel={false}
            >
              <TextField source="name" />
            </ReferenceField>
          );
        }}
      </ReferenceFieldController>
```
@fzaninotto fzaninotto merged commit 14c8a62 into marmelab:master Dec 15, 2021
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 3.19.4 milestone Dec 15, 2021
@kevinmamaqi kevinmamaqi deleted the patch-1 branch December 15, 2021 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants