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 compilation error in MenuItemLink, ResettableTextField and InpectorButton with latest @types/react #9853

Merged

Conversation

ilia-os
Copy link
Contributor

@ilia-os ilia-os commented May 16, 2024

Closes #9737

Problem

@types/react v18.2.66 update makes some of our components require extra props.

  1. MenuItemLink - requires onPointerEnterCapture, onPointerLeaveCapture
  2. ResettableTextField - requires onPointerEnterCapture, onPointerLeaveCapture
  3. InspectorButton - requires onPointerEnterCapture, onPointerLeaveCapture and placeholder

Probably InspectorButton.placeholder issue was introduced even before v18.2.66

This breaks new apps bootstrapped from create-react-admin - you'll get typescript error if using these components

Solution

Explicitly omit these otherwise junk props and allow to use the components without compilation error

@fzaninotto fzaninotto changed the title fix(typescript) fix @types/react v18.2.66 issue introducing extra required props [Typescript] Fix compilation error in MenuItemLink, ResettableTextField and InpectorButton with latest @types/react May 17, 2024
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

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

Thanks!

@slax57 slax57 added this to the 4.16.18 milestone May 17, 2024
@slax57 slax57 merged commit 570c376 into marmelab:master May 17, 2024
11 checks passed
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.

react admin error with Menu.Item missing properties
3 participants