[@wordpress/components] [TypeScript] Unnecessary Requirement of Pointer Events on SVG Components #61322
Labels
Good First Issue
An issue that's suitable for someone looking to contribute for the first time
[Package] Components
/packages/components
[Type] Bug
An existing feature does not function as intended
Description
When using SVG-based components such as the Spinner from @wordpress/components, TypeScript errors are generated unless pointer event handlers like
onPointerEnterCapture
andonPointerLeaveCapture
are provided. These properties should not be required for components like<Spinner/>
, but the current TypeScript types make them mandatory, leading to an unnecessary complication for developers.The problem most likely lies in these types: https://github.com/WordPress/gutenberg/blob/ed678300cf67d234b57291b4f5e04505a5d72ec7/packages/components/src/context/wordpress-component.ts
Step-by-step reproduction instructions
Spinner
component from@wordpress/components
.<Spinner />
.onPointerEnterCapture
andonPointerLeaveCapture
which should not be mandatory.Screenshots, screen recording, code snippet
Environment info
@wordpress/compoennts
: 27.4.0Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: