Skip to content

Conversation

jonathanarnault
Copy link
Contributor

Depends on #10996

Problem

A lot of RA components expect a ReactElement where a ReactNode could be used.

Solution

Replace ReactElement with ReactNode where applicable.

How To Test

N/A

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)
  • The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

Also, please make sure to read the contributing guidelines.

@jonathanarnault jonathanarnault changed the title Chore: Use ReactNode instead of ReactElement where applicable [Chore] Use ReactNode instead of ReactElement where applicable Oct 20, 2025
@jonathanarnault jonathanarnault added the RFR Ready For Review label Oct 20, 2025
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

I think you missed the <Datagrid expand> prop as it takes a ReactNode too according to both the doc and JSDoc (https://github.com/marmelab/react-admin/pull/10998/files#diff-1458ac898ea2924cc9ba84a442d85a75980a77a4f53823799136600375603063R401)

| `body` | Optional | `ReactNode` | `<Datagrid Body>` | The component used to render the body of the table. |
| `bulkActionButtons` | Optional | `ReactNode` | `<BulkDelete Button>` | The component used to render the bulk action buttons. |
| `empty` | Optional | `ReactNode` | `<Empty>` | The component used to render the empty table. |
| `expand` | Optional | `ReactElement` | | The component used to render the expand panel for each row. |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| `expand` | Optional | `ReactElement` | | The component used to render the expand panel for each row. |
| `expand` | Optional | `ReactNode` | | The component used to render the expand panel for each row. |

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