mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 19:19:26 +08:00
2cdf586291
* chore: fix lint * chore: fix lint * test: fix 16 * fix: lint
22 lines
542 B
TypeScript
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;
|