I have added DatePicker to my SPFX web part.I wanted to get selected date from DatePicker control. Find the following code to get date:
import {DatePicker} from 'office-ui-fabric-react';
<DatePicker className="form-control" id="duedate" value={this.state.DueDate} onChange={(event) => this.handleDateChange(event)} selected={this.state.DueDate}/>
I get following error because selected property does not exist.
Type '{ className: string; id: string; placeholder: string; value: Date; onChange: (event: FormEvent) => void; selected: Date; }' is not assignable to type 'IntrinsicAttributes & IDatePickerProps & { children?: ReactNode; }'. Property 'selected' does not exist on type 'IntrinsicAttributes & IDatePickerProps & { children?: ReactNode; }'.
Appreciate your thoughts on how to fix this issue.