When I have SCRIPT_DEBUG enabled everytime I add my custom block I get the following warning:
Warning: Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.
this is the edit function:
export default function Edit({ attributes, setAttributes }) {
const blockProps = useBlockProps( {
className: 'my-random-classname-test',
} );
const {
background_color
} = attributes;
function onChangeBgColor ( colorValue ) {
setAttributes({background_color: colorValue})
}
return ([
<InspectorControls>
<PanelBody>
<PanelColorSettings // Element Tag for Gutenberg standard colour selector
title= { 'Background Colour' }
colorSettings = {[
{
value: background_color,
onChange: ( colorValue ) => onChangeBgColor(colorValue),
label: __( 'Background Color' ),
}
]}
/>
</PanelBody>
</InspectorControls>,
<div { ...blockProps }>
<div style={ { backgroundColor: background_color } }>this is another panel</div>
</div>
]);
}
When I have SCRIPT_DEBUG enabled everytime I add my custom block I get the following warning:
Warning: Each child in a list should have a unique "key" prop. See https://fb.me/react-warning-keys for more information.this is the edit function: