mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-01 06:49:32 +08:00
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:
parent
e91f927784
commit
eaa86351e4
@ -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`, {
|
||||
|
Loading…
Reference in New Issue
Block a user