ColorPresets: fix duplicate keys (#44370)

* ColorPresets: fix duplicate keys

Signed-off-by: xr0master <xr0master@gmail.com>

* Update components/color-picker/components/ColorPresets.tsx

add lint disable

Signed-off-by: xr0master <xr0master@gmail.com>

---------

Signed-off-by: xr0master <xr0master@gmail.com>
This commit is contained in:
xr0master 2023-08-24 08:26:26 +03:00 committed by GitHub
parent e91f927784
commit eaa86351e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,9 +59,10 @@ const ColorPresets: FC<ColorPresetsProps> = ({ prefixCls, presets, value: color,
children: (
<div className={`${colorPresetsPrefixCls}-items`}>
{Array.isArray(preset?.colors) && preset.colors?.length > 0 ? (
preset.colors.map((presetColor: Color) => (
preset.colors.map((presetColor: Color, index: number) => (
<ColorBlock
key={`preset-${presetColor.toHexString()}`}
// eslint-disable-next-line react/no-array-index-key
key={`preset-${index}-${presetColor.toHexString()}`}
color={generateColor(presetColor).toRgbString()}
prefixCls={prefixCls}
className={classNames(`${colorPresetsPrefixCls}-color`, {