-
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
Edit Post: Replace 'withPluginContext' in the 'PluginPostPublishPanel' #53302
Conversation
Size Change: +881 B (0%) Total Size: 1.44 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.
LGTM, thanks 👍 🚀
Left a minor suggestion, but it's optional, feel free to ignore.
import { createSlotFill, PanelBody } from '@wordpress/components'; | ||
|
||
const { Fill, Slot } = createSlotFill( 'PluginPostPublishPanel' ); | ||
|
||
const PluginPostPublishPanelFill = ( { |
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.
There was indeed no need to have this as a separate component 👍
packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js
Outdated
Show resolved
Hide resolved
packages/edit-post/src/components/sidebar/plugin-post-publish-panel/index.js
Outdated
Show resolved
Hide resolved
…panel/index.js Co-authored-by: Marin Atanasov <[email protected]>
…panel/index.js Co-authored-by: Marin Atanasov <[email protected]>
What?
PR replaces the use of
withPluginContext
in thePluginPostPublishPanel
component with the newusePluginContext
hook.Why?
The
useContext
hook or its wrappers is recommended way to consume context in modern React.Testing Instructions
Code
Screenshots or screencast