Skip to content

Core blocks: Stop using withAPIData for Latest Posts block in code and docs #7397

Description

@gziolo

Raised by @mrleemon in #7390:

It might be a good idea to update the handbook section dedicated to building dynamic blocks cause it still makes reference to withAPIData:

https://wordpress.org/gutenberg/handbook/blocks/creating-dynamic-blocks/

We should refactor Latest Posts block to use withSelect instead of withAPIData and update all docs to follow the same pattern. We are planning to deprecate withAPIData, so let's make sure it is no longer exposed in Gutenberg handbook.

More details on how to perform migration is shared in #7390.

There is also a known bug with a race condition inside withAPIData that has been around for quite some time. This is another reason why we should migrate our codebase sooner than later.

Metadata

Metadata

Assignees

Labels

Good First IssueAn issue that's suitable for someone looking to contribute for the first time[Feature] BlocksOverall functionality of blocks[Package] Data/packages/data[Priority] HighUsed to indicate top priority items that need quick attention[Type] Developer DocumentationDocumentation for developers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions