import { Input } from 'antd'; import React, { Fragment } from 'react'; import styles from './PhoneView.less'; interface PhoneProps { value?: string; onChange?: (e: string) => void; } const PhoneView: React.FC = props => { const { value, onChange } = props; let values = ['', '']; if (value) { values = value.split('-'); } return ( { onChange(`${e.target.value}-${values[1]}`); }} /> { onChange(`${values[0]}-${e.target.value}`); }} value={values[1]} /> ); }; export default PhoneView;