@@ -13,7 +13,7 @@ import {
13
13
__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue ,
14
14
Disabled ,
15
15
} from '@wordpress/components' ;
16
- import { withSelect } from '@wordpress/data' ;
16
+ import { useSelect } from '@wordpress/data' ;
17
17
import { __ } from '@wordpress/i18n' ;
18
18
import {
19
19
InspectorControls ,
@@ -40,7 +40,7 @@ const MAX_TAGS = 100;
40
40
const MIN_FONT_SIZE = 0.1 ;
41
41
const MAX_FONT_SIZE = 100 ;
42
42
43
- function TagCloudEdit ( { attributes, setAttributes, taxonomies } ) {
43
+ function TagCloudEdit ( { attributes, setAttributes } ) {
44
44
const {
45
45
taxonomy,
46
46
showTagCounts,
@@ -53,6 +53,10 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
53
53
const units = useCustomUnits ( {
54
54
availableUnits : availableUnits || [ '%' , 'px' , 'em' , 'rem' ] ,
55
55
} ) ;
56
+ const taxonomies = useSelect (
57
+ ( select ) => select ( coreStore ) . getTaxonomies ( { per_page : - 1 } ) ,
58
+ [ ]
59
+ ) ;
56
60
57
61
const getTaxonomyOptions = ( ) => {
58
62
const selectOption = {
@@ -174,8 +178,4 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
174
178
) ;
175
179
}
176
180
177
- export default withSelect ( ( select ) => {
178
- return {
179
- taxonomies : select ( coreStore ) . getTaxonomies ( { per_page : - 1 } ) ,
180
- } ;
181
- } ) ( TagCloudEdit ) ;
181
+ export default TagCloudEdit ;
0 commit comments