From 2460a04abd8c8f322b1007f14a2e7221fe726d01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alba=20Rinc=C3=B3n?= Date: Thu, 15 Jun 2023 16:21:02 +0200 Subject: [PATCH] Remove propTypes (https://github.com/woocommerce/woocommerce-blocks/pull/9824) --- .../assets/js/blocks/active-filters/block.tsx | 34 +++++++------------ 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/plugins/woocommerce-blocks/assets/js/blocks/active-filters/block.tsx b/plugins/woocommerce-blocks/assets/js/blocks/active-filters/block.tsx index 58a078e97e3..77863b174b1 100644 --- a/plugins/woocommerce-blocks/assets/js/blocks/active-filters/block.tsx +++ b/plugins/woocommerce-blocks/assets/js/blocks/active-filters/block.tsx @@ -6,7 +6,6 @@ import { useQueryStateByKey } from '@woocommerce/base-context/hooks'; import { getSetting, getSettingWithCoercion } from '@woocommerce/settings'; import { useMemo, useEffect, useState } from '@wordpress/element'; import classnames from 'classnames'; -import PropTypes from 'prop-types'; import Label from '@woocommerce/base-components/label'; import { isAttributeQueryCollection, @@ -18,6 +17,7 @@ import { import { getUrlParameter } from '@woocommerce/utils'; import FilterTitlePlaceholder from '@woocommerce/base-components/filter-placeholder'; import { useIsMounted } from '@woocommerce/base-hooks'; +import type { BlockAttributes } from '@wordpress/blocks'; /** * Internal dependencies @@ -34,23 +34,26 @@ import { } from './utils'; import ActiveAttributeFilters from './active-attribute-filters'; import FilterPlaceholders from './filter-placeholders'; -import { Attributes } from './types'; import { useSetWraperVisibility } from '../filter-wrapper/context'; +interface ActiveFiltersBlockProps { + /** + * The attributes for this block. + */ + attributes: BlockAttributes; + /** + * Whether it's in the editor or frontend display. + */ + isEditor: boolean; +} + /** * Component displaying active filters. - * - * @param {Object} props Incoming props for the component. - * @param {Object} props.attributes Incoming attributes for the block. - * @param {boolean} props.isEditor Whether or not in the editor context. */ const ActiveFiltersBlock = ( { attributes: blockAttributes, isEditor = false, -}: { - attributes: Attributes; - isEditor?: boolean; -} ) => { +}: ActiveFiltersBlockProps ) => { const setWrapperVisibility = useSetWraperVisibility(); const isMounted = useIsMounted(); const componentHasMounted = isMounted(); @@ -413,15 +416,4 @@ const ActiveFiltersBlock = ( { ); }; -ActiveFiltersBlock.propTypes = { - /** - * The attributes for this block. - */ - attributes: PropTypes.object.isRequired, - /** - * Whether it's in the editor or frontend display. - */ - isEditor: PropTypes.bool, -}; - export default ActiveFiltersBlock;