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

Data: Refactor query HOC usage with withSelect #5215

Merged
merged 1 commit into from
Feb 23, 2018

Conversation

gziolo
Copy link
Member

@gziolo gziolo commented Feb 23, 2018

Description

There are a few deprecations warnings on the JS console coming from query HOC. This PR refactors all code occurrences to use new withSelect HOC.

How Has This Been Tested?

Make sure there are no warnings on the JS console and there are no regressions.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

@gziolo gziolo added the [Feature] UI Components Impacts or related to the UI component system label Feb 23, 2018
@gziolo gziolo self-assigned this Feb 23, 2018
@gziolo gziolo requested a review from a team February 23, 2018 12:41
@@ -47,7 +47,7 @@ const SidebarHeader = ( { panel, onSetPanel, onCloseSidebar, count } ) => {
};

export default compose(
query( ( select ) => ( {
withSelect( ( select ) => ( {
count: select( 'core/editor' ).getSelectedBlockCount(),
} ) ),
Copy link
Member Author

@gziolo gziolo Feb 23, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

connect should go next as soon as we expose all selectors and actions :)

Copy link
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@gziolo gziolo merged commit eba2144 into master Feb 23, 2018
@gziolo gziolo deleted the update/query-with-select branch February 23, 2018 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants