Update Edit props type for toggle

This commit is contained in:
Matt Sherman 2023-09-27 23:42:05 -04:00
parent f781940c27
commit 1d21956def
2 changed files with 3 additions and 3 deletions

View File

@ -2,7 +2,6 @@
* External dependencies
*/
import { createElement } from '@wordpress/element';
import { BlockEditProps } from '@wordpress/blocks';
import { useEntityProp } from '@wordpress/core-data';
import { ToggleControl } from '@wordpress/components';
import { useWooBlockProps } from '@woocommerce/block-templates';
@ -12,10 +11,11 @@ import { useWooBlockProps } from '@woocommerce/block-templates';
*/
import { ToggleBlockAttributes } from './types';
import { sanitizeHTML } from '../../utils/sanitize-html';
import { ProductEditorBlockEditProps } from '../../types';
export function Edit( {
attributes,
}: BlockEditProps< ToggleBlockAttributes > ) {
}: ProductEditorBlockEditProps< ToggleBlockAttributes > ) {
const blockProps = useWooBlockProps( attributes );
const { label, property, disabled, disabledCopy } = attributes;
const [ value, setValue ] = useEntityProp< boolean >(

View File

@ -22,6 +22,6 @@ export function init() {
return registerWooBlockType( {
name,
metadata: metadata as never,
settings,
settings: settings as never,
} );
}