Im using react type script project for ant design3 date picker, they are not provided year picker and i got a some solution and is it here mode="year"
, then year picker is working but cant bind the value , selected year not display. any one know some solution for this?
Thanks
code here
import React from 'react';
import ReactDOM from 'react-dom';
import 'antd/dist/antd.css';
import './index.css';
import { DatePicker } from 'antd';
const { MonthPicker, RangePicker, WeekPicker, } = DatePicker;
function onChange(date, dateString) {
console.log(date, dateString);
}
ReactDOM.render(
<div>
<DatePicker onChange={onChange} mode="year" placeholder="Select year"/>
<br />
<br />
</div>,
document.getElementById('container'),
);
Are you using a different version of antd? This demo is working correctly. click here.