Browse Source

chore: enhance PanelPresets type (#43486)

* docs: update examples link

* type: fix typescript error

* chore: code clean
pull/43490/head 5.7.0
MadCcc 1 year ago
committed by GitHub
parent
commit
36f195d411
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      components/color-picker/components/PanelPresets.tsx

8
components/color-picker/components/PanelPresets.tsx

@ -12,11 +12,9 @@ export interface PanelPresetsProps extends Pick<ColorPickerBaseProps, 'prefixCls
const PanelPresets: FC = () => {
const { prefixCls, value, presets, onChange } = useContext(PanelPresetsContext);
return (
Array.isArray(presets) && (
<ColorPresets value={value} presets={presets} prefixCls={prefixCls} onChange={onChange} />
)
);
return Array.isArray(presets) ? (
<ColorPresets value={value} presets={presets} prefixCls={prefixCls} onChange={onChange} />
) : null;
};
export default PanelPresets;

Loading…
Cancel
Save