Update Edit props type for toggle
This commit is contained in:
parent
f781940c27
commit
1d21956def
|
@ -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 >(
|
||||
|
|
|
@ -22,6 +22,6 @@ export function init() {
|
|||
return registerWooBlockType( {
|
||||
name,
|
||||
metadata: metadata as never,
|
||||
settings,
|
||||
settings: settings as never,
|
||||
} );
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue