A simple and reusable dropdown datepicker component for React (Demo)
npm install --save react-select-datepicker
import React, { useState, useCallback } from 'react';
import { SelectDatepicker } from 'react-select-datepicker';
export const App = () => {
const [value, setValue] = useState<Date | null>();
const onDateChange = useCallback((date: Date) => {
setValue(date);
}, []);
return (
<SelectDatepicker
selectedDate={value}
onDateChange={onDateChange}
/>
);
};
MIT © JMcAmmond