Site icon Hip-Hop Website Design and Development

Gutenberg: useDispatch is not a function – @wordpress/data included

I have the @wordpress/data package installed, but I can’t use useDispatch in my block edit function:

const { registerBlockType } = wp.blocks;
const { useDispatch, useSelect } = wp.data;
.
.
.
registerBlockType( 'rb-bootstrap/grid', {
    ...
    edit: function( props ) {
         const { replaceInnerBlocks } = useDispatch("core/block-editor");
    }
}

TypeError: useDispatch is not a function

What am I missing?