import React from 'react' ; import { SketchPicker } from 'react-color' ; type Props = { value ? : string ; onChange ? : ( value : string ) => void ; } ; interface ColorPicker { ( props ) : JSX . Element | null ; } const ColorPicker = ( { value , onChange } ) => { const handleColorChange = ( { hex } ) => { onChange && onChange ( hex ) ; } ; return < SketchPicker color = { value } onChangeComplete = { handleColorChange } / > ; } ; export default ColorPicker ;