Update Edit props type for radio

This commit is contained in:
Matt Sherman 2023-09-27 23:40:34 -04:00
parent 5be0716466
commit 0ad7126f5f
2 changed files with 5 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 { useWooBlockProps } from '@woocommerce/block-templates';
@ -11,8 +10,11 @@ import { useWooBlockProps } from '@woocommerce/block-templates';
*/
import { RadioField } from '../../components/radio-field';
import { RadioBlockAttributes } from './types';
import { ProductEditorBlockEditProps } from '../../types';
export function Edit( { attributes }: BlockEditProps< RadioBlockAttributes > ) {
export function Edit( {
attributes,
}: ProductEditorBlockEditProps< RadioBlockAttributes > ) {
const blockProps = useWooBlockProps( attributes );
const { description, options, property, title } = attributes;
const [ value, setValue ] = useEntityProp< string >(

View File

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