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 <ReferenceArrayField queryOptions> param type #10389

Merged

Conversation

dricholm
Copy link
Contributor

Fixes #10379

Problem

ReferenceArrayField's queryOptions required queryFn and queryKey props even though these should be optional.

Solution

Update types to omit the above two fields.
Also aligned the types between ReferenceField, ReferenceArrayField and useReferenceFieldController.

How To Test

Create a <ReferenceArrayField queryOptions={{}} /> and confirm no type errors occur on queryOptions stating that queryFn and queryKey are required.

Additional Checks

  • The PR targets master for a bugfix, or next for a feature
  • The PR includes unit tests (if not possible, describe why)
    • Didn't see an existing unit test yet, should a new one be added?
  • The PR includes one or several stories (if not possible, describe why)
    • Unsure if story is required for this change. Please let me know if you have an idea.
  • The documentation is up to date

Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

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

Thanks for your patch!

@fzaninotto fzaninotto merged commit 77f7ed8 into marmelab:master Nov 27, 2024
14 checks passed
@fzaninotto
Copy link
Member

Thanks!

@fzaninotto fzaninotto added this to the 5.4.1 milestone Nov 27, 2024
@fzaninotto fzaninotto changed the title Align queryOptions type in reference components and controller [TypeScript] Fix <ReferenceArrayField queryOptions> param type Nov 27, 2024
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.

Incorrect type for queryOptions in ReferenceArrayField
2 participants