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

[TypeScript] Add the ability to type SimpleList callbacks #6254

Merged
merged 2 commits into from
May 7, 2021

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented May 7, 2021

Problem

Many of the <SimpleList> props are callback that expect a Record argument. But TypeScript complains when accessing fields of these records, and that forces to add // @ts-ignore flags.

image

Solution

Make <SimpleList> generic to accept a Record type.

@djhi djhi added this to the 3.15.1 milestone May 7, 2021
@djhi djhi merged commit 14c6bbc into next May 7, 2021
@djhi djhi deleted the generic-simplelist branch May 7, 2021 06:51
@fzaninotto fzaninotto modified the milestones: 3.15.1, 3.16.0 May 7, 2021
ken1901 pushed a commit to ken1901/react-admin that referenced this pull request Feb 11, 2023
[TypeScript] Add the ability to type SimpleList callbacks
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