import clsx from 'clsx'; import React from 'react'; import styles from './styles.scss'; type SwitchProps = { checked?: boolean; disable?: boolean; title?: string; onChange?: (...args: any[]) => any; dataSign?: string; className?: string; }; const Switch: React.FC = (props) => { const onChange = props.onChange ? // @ts-expect-error TS(2722): Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message (e: any) => !props.disable && props.onChange(e.currentTarget.checked) : undefined; return (