Site icon Hip-Hop Website Design and Development

WordPress Gutenberg react make import of __experimentalUseInnerBlocksProps which is no more experimetal

I have a plugin with import

import { __experimentalUseInnerBlocksProps as useInnerBlocksProps } from '@wordpress/block-editor';

but it’s not working with newest Gutenberg plugin 11.9, because this useInnerBlocksProps is no longer experimental

so I can use

import { useInnerBlocksProps } from '@wordpress/block-editor';

but then it will not work for older versions, or WordPress installation without Gutenberg plugin.

What’s the correct way to make it compatible with both scenarios? How to import __experimentalUseInnerBlocksProps if exists and directly useInnerBlocksProps if not?