mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-28 05:05:48 +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: (
|
children: (
|
||||||
<div className={`${colorPresetsPrefixCls}-items`}>
|
<div className={`${colorPresetsPrefixCls}-items`}>
|
||||||
{Array.isArray(preset?.colors) && preset.colors?.length > 0 ? (
|
{Array.isArray(preset?.colors) && preset.colors?.length > 0 ? (
|
||||||
preset.colors.map((presetColor: Color) => (
|
preset.colors.map((presetColor: Color, index: number) => (
|
||||||
<ColorBlock
|
<ColorBlock
|
||||||
key={`preset-${presetColor.toHexString()}`}
|
// eslint-disable-next-line react/no-array-index-key
|
||||||
|
key={`preset-${index}-${presetColor.toHexString()}`}
|
||||||
color={generateColor(presetColor).toRgbString()}
|
color={generateColor(presetColor).toRgbString()}
|
||||||
prefixCls={prefixCls}
|
prefixCls={prefixCls}
|
||||||
className={classNames(`${colorPresetsPrefixCls}-color`, {
|
className={classNames(`${colorPresetsPrefixCls}-color`, {
|
||||||
|
Loading…
Reference in New Issue
Block a user