mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
13 lines
355 B
TypeScript
13 lines
355 B
TypeScript
import React, { useState } from 'react';
|
|
import { ColorPicker } from 'antd';
|
|
import type { ColorPickerProps, GetProp } from 'antd';
|
|
|
|
type Color = GetProp<ColorPickerProps, 'value'>;
|
|
|
|
const Demo: React.FC = () => {
|
|
const [color, setColor] = useState<Color>('#1677ff');
|
|
return <ColorPicker value={color} onChange={setColor} />;
|
|
};
|
|
|
|
export default Demo;
|