import React from 'react'; interface YYMMDD { year: number; month: number; day: number; } interface YYMMDDInputProps { value: YYMMDD; onChange: (date: YYMMDD) => void; } export class YYMMDDInput extends React.Component { _year = React.createRef(); _month = React.createRef(); _day = React.createRef(); _onBlur = () => { const year = Number(this._year.current.value); const month = Number(this._month.current.value); const day = Number(this._day.current.value); this.props.onChange({ year, month, day }); }; render() { const { year, month, day } = this.props.value; return (
); } }