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] Fix TS errors with <ArrayField> and <ChipField> in stories #9132

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

slax57
Copy link
Contributor

@slax57 slax57 commented Jul 25, 2023

Fixes errors such as the following in ArrayField.stories.tsx:

Type '{ children: Element; record: { id: number; books: { id: number; title: string; author_id: number; }[]; }; source: string; }' is not assignable to type 'IntrinsicAttributes & { children?: ReactNode; }'.
  Property 'record' does not exist on type 'IntrinsicAttributes & { children?: ReactNode; }'.ts(2322)

Basically, if the children prop type is not exactly the same as what React expects (ReactNode | undefined), the type of the component will be React.FunctionComponent<{}> instead if the declared type (and hence every additional prop is not recognized)

@slax57 slax57 added the RFR Ready For Review label Jul 25, 2023
@fzaninotto fzaninotto merged commit 4d25543 into master Jul 26, 2023
8 checks passed
@fzaninotto fzaninotto deleted the fix-ts-error-stories-FC branch July 26, 2023 06:22
@fzaninotto fzaninotto added this to the 4.12.3 milestone Jul 26, 2023
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