Skip to content

Fix <ShowGuesser> print incorrect code for reference arrays#10682

Merged
slax57 merged 1 commit intomasterfrom
fix-guessers-reference-array
Apr 18, 2025
Merged

Fix <ShowGuesser> print incorrect code for reference arrays#10682
slax57 merged 1 commit intomasterfrom
fix-guessers-reference-array

Conversation

@djhi
Copy link
Contributor

@djhi djhi commented Apr 18, 2025

Problem

The console.log for reference arrays is wrong:

<ReferenceArrayField source="tags_ids" reference="tags"><TextField source="id" /></ReferenceArrayField>

It should be:

<ReferenceArrayField source="tags_ids" reference="tags" />

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)

@djhi djhi added the RFR Ready For Review label Apr 18, 2025
Comment on lines +89 to +95
component: () => (
<SingleFieldList>
<ChipField source="id" />
</SingleFieldList>
),
representation: () =>
`<SingleFieldList><ChipField source="id" /></SingleFieldList>`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't you remove the referenceArrayChild key altogether? I'm worried the rendered JSX does not match the JSX code printed in the console.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be used by guessers we don't maintain so I'd rather keep it

@slax57 slax57 added this to the 5.7.3 milestone Apr 18, 2025
@slax57 slax57 merged commit c2d8edc into master Apr 18, 2025
16 checks passed
@slax57 slax57 deleted the fix-guessers-reference-array branch April 18, 2025 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Development

Successfully merging this pull request may close these issues.

2 participants