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

@wordpress/editor component types are broken since the last update #67195

Closed
2 of 6 tasks
manzoorwanijk opened this issue Nov 21, 2024 · 0 comments · Fixed by #67196
Closed
2 of 6 tasks

@wordpress/editor component types are broken since the last update #67195

manzoorwanijk opened this issue Nov 21, 2024 · 0 comments · Fixed by #67196
Assignees
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@manzoorwanijk
Copy link
Member

Description

Since the last update of @wordpress/editor - v14.12.0, the TS types for some components and some actions are broken.

Step-by-step reproduction instructions

  • Import any component with @return set to {Component}
    e.g.
import { PostTypeSupportCheck } from '@wordpress/editor';
import { PluginDocumentSettingPanel } from '@wordpress/edit-post';

<PostTypeSupportCheck supportKeys="excerpt">
	<PluginDocumentSettingPanel name="some-name" title={ 'Some title' }>
		Something here
	</PluginDocumentSettingPanel>
</PostTypeSupportCheck>

See the TS error

Image

  • Use editPost action

e.g.

import { dispatch } from '@wordpress/data';
import { store as editorStore } from '@wordpress/editor';

const { editPost } = dispatch( editorStore );

editPost( { title: 'Test' } );

See the error Expected 2 arguments, but got 1.ts(2554)
Image

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure
@manzoorwanijk manzoorwanijk added the [Type] Bug An existing feature does not function as intended label Nov 21, 2024
@github-actions github-actions bot added the [Status] In Progress Tracking issues with work in progress label Nov 21, 2024
@manzoorwanijk manzoorwanijk changed the title @wordpress/editor component types are broken with the last update @wordpress/editor component types are broken since the last update Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant