Typescript:

This package contains built-in TypeScript declarations.

Day, Range and Multi are the three types of value that you can initialize to your date picker based on the date picker type ( single, range, multi ) that you choose to use.


import DtPicker, { Day, Range, Multi  } from 'react-calendar-datetime-picker'

const DatePicker = () => {
  const [date, setDate] = useState<Day>(null)
  const [dateRange, setDateRange] = useState<Range>(null)
  const [dateMulti, setDateMulti] = useState<Multi>(null)

  return (
    <div>
      <DtPicker
        onChange={setDate}
        type="single"
        placeholder='select single day'
      />
      <DtPicker
        onChange={setDateRange}
        type="range"
        placeholder='select range of days'
      />
      <DtPicker
        onChange={setDateMulti}
        type='multi'
        placeholder='select multi days'
      />
    </div>
  )
}
export default DatePicker

value:
value:
null
value:
null