Using RenderApender with innerBlocksProps
-
Hello everyone
I’m trying to use the InnerBlocks ButtonBlockAppender inside a custom block, where I use Block- and InnerBlocksProps. But it doesn’t work…
My question: Is this even possible or is there another way?
I know I just could use the InnerBlock Component instead of BlockProps but that wouldn’t be as “satisfying”I’ve tried like this:
const {useBlockProps, useInnerBlocksProps, InnerBlocks} = wp.blockEditor; export default ({setAttributes, clientId}) => { setAttributes({accordionId: clientId}); const blockProps = useBlockProps(); const innerBlockProps = useInnerBlocksProps( { className: 'accordion', }, { allowedBlocks: ['test/accordion-item'], }, { template: [['test/accordion-item', {}]], }, { renderAppender: InnerBlocks.ButtonBlockAppender, }, ); return ( <>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Using RenderApender with innerBlocksProps’ is closed to new replies.