-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Latest Posts block: Refactor to drop apiFetch usage in favor of using the data module #33063
Conversation
Size Change: -6 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things worked well on my tests 👍 I tested the category autocomplete and the user select field of the latest posts block.
@@ -377,7 +349,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { | |||
'' !== value ? Number( value ) : undefined, | |||
} ) | |||
} | |||
authorList={ authorList } | |||
authorList={ authorList ?? [] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: Maybe we can use a shared EMPTY_ARRAY reference to avoid rerenders.
1d94efb
to
e3eeb7f
Compare
… the data module (#33063)
I'm just continuing my refactors to remove the usage of apiFetch in block-library and editor packages to make these two packages WP-agnostic (considering the data module an adaptable interface to any backend)
Testing instructions