I had an idea of using hooks to provide super quick to create block inspector controls. You'd call the hook with an attribute and attribute name, and it would return the value and an inspector component ready to slot into a block inspector slot
Something like this:
const { title, titleControl } = useTextField( 'title', attributes.title );
const { headerImageSrc, headerImageId, headerImageControl } = useImageField( 'headerImageId' attributes.headerImageId );
<InspectorControls>
{ titleControl }
{ headerImageControl }
</InspectorControls>
I can see this being a super easy way to spin up a blocks attributes and their UI for checkboxes, images, etc
I had an idea of using hooks to provide super quick to create block inspector controls. You'd call the hook with an attribute and attribute name, and it would return the value and an inspector component ready to slot into a block inspector slot
Something like this:
I can see this being a super easy way to spin up a blocks attributes and their UI for checkboxes, images, etc