import React from 'react'; import { Flex, Input, Typography } from 'antd'; import type { GetProps } from 'antd'; type OTPProps = GetProps; const { Title } = Typography; const App: React.FC = () => { const onChange: OTPProps['onChange'] = (text) => { console.log('onChange:', text); }; const onInput: OTPProps['onInput'] = (value) => { console.log('onInput:', value); }; const sharedProps: OTPProps = { onChange, onInput, }; return ( With formatter (Upcase) str.toUpperCase()} {...sharedProps} /> With Disabled With Length (8) With variant With custom display character ); }; export default App;