Gutenberg get index of gutenberg innerblock
You may now retrieve the index of a inner block via the core/block-editor data module. You may pair it with the useSelect hook to keep the indexes up to date on changes. Something like this. Intentionally verbose for clarity. import {useSelect} from ‘@wordpress/data’; const Answer = ( blockProps ) => { const {index} = useSelect( … Read more