react-tailwindcss-datepicker
react-tailwindcss-datepicker copied to clipboard
How do I update Documentation?
In the doc, demo code shows as follow:
import React, {useState} from "react";
import Datepicker from "react-tailwindcss-datepicker";
const App = () => {
const [value, setValue] = useState({
startDate: null
endDate: null
});
const handleValueChange = (newValue) => {
console.log("newValue:", newValue);
setValue(newValue);
}
return (
<Datepicker
value={value}
onChange={handleValueChange}
showShortcuts={true}
/>
);
};
export default App;
But using "strict" type-checking option enabled, above code doesn't work.
I suggest following demo code to be updated on the doc.
import React, {useState} from "react";
import Datepicker, { DateValueType } from "react-tailwindcss-datepicker";
const App = () => {
const [date, setDate] = useState<DateValueType>(null);
return (
<Datepicker
i18n={"ko"}
asSingle={true}
useRange={false}
value={date}
onChange={setDate}
/>
);
};
export default App;
version: "react-tailwindcss-datepicker": "^1.6.6"