BoxControl component issue
-
It would be great if someone help me to resolve this issue. I am trying to create a gutenberg block and having some issue to use the BoxControl component.
import { useState } from "@wordpress/element";
import { BoxControl } from '@wordpress/components';
function TestComponent() {
const [padding, setPadding] = useState({ top: '10px', bottom: '10px' });
return (
<BoxControl
label="Padding"
values={padding}
onChange={(value) => setPadding(value)}
/>
);
}
export default TestComponent;Error: type is invalid — expected a string (for built-in components) or a class/function (for composite components) but got: undefined
I tried to console the BoxControl component and i get undefined.
I am using latest version of the followings WordPress, @wordpress/scripts and @wordpress/components.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘BoxControl component issue’ is closed to new replies.