Open joshualip-plaudit opened 4 days ago
Hello @joshualip-plaudit ,
I attempted to replicate the issue using the code snippet you provided but was unable to reproduce it. Could you please share a screencast demonstrating the problem and provide additional details to help us better understand the issue?
Looking forward to collaborating and resolving this together!
Thanks
@Mayank-Tripathi32 Did you run the build process via wp-scripts build? I forgot to mention that I have it configured to actually type-check what it's building (the babel preset used in wp-scripts drops types rather than checking them).
The screenshot shows the outcome of using the wp-scripts build command first and tsc second. The tsc command identifies that the children property is undefined, which is the issue that I'm encountering.
@manzoorwanijk Thank you!
Description
Trying to build a plugin that adds an item to the "More" menu via the PluginMoreMenuItem component using versions of the editor package that export their own type definitions for the components sub-package (14.11.0 and higher) results in the error:
Property 'children' does not exist on type 'IntrinsicAttributes & { href?: string | undefined; icon?: any; onClick?: Function | undefined; other?: any[] | undefined; }'.
The error is caused by the JSDoc for PluginMoreMenuItem (and the other Plugin*MenuItem components) missing the
* @param {Element} props.children Children to be rendered
line included in the Plugin* components that are not MenuItems (I copied that line specifically from PluginPostPublishPanel).Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
The issue is with the build process, so plugins, WP version, etc aren't relevant. The only relevant version is "@wordpress/editor", which must be version 14.11.0 or higher.
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.