ant-design/components/color-picker/demo/change-completed.tsx
二货爱吃白萝卜 2cdf586291
chore: fix lint (#43873)
* chore: fix lint

* chore: fix lint

* test: fix 16

* fix: lint
2023-07-28 16:17:43 +08:00

22 lines
542 B
TypeScript

import React, { useState } from 'react';
import { App, ColorPicker } from 'antd';
import type { ColorPickerProps } from 'antd/es/color-picker';
const Demo = () => {
const { message } = App.useApp();
const [value, setValue] = useState<ColorPickerProps['value']>('#1677ff');
return (
<App>
<ColorPicker
value={value}
onChangeComplete={(color) => {
setValue(color);
message.success(`The selected color is ${color.toHexString()}`);
}}
/>
</App>
);
};
export default Demo;