Skip to content

Commit bb94aa5

Browse files
committed
Update README.md 📚
1 parent 2ef44b3 commit bb94aa5

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# React Tailwindcss Datepicker
22

3-
<p align="center">
3+
<p style="text-align: center">
44
<a href="https://react-tailwindcss-datepicker.vercel.app/" target="_blank">
55
<img alt="React Tailwindcss Datepicker" width="100" style="border-radius: 100%;" src="https://raw.githubusercontent.com/onesine/react-tailwindcss-datepicker/master/assets/img/calendar_logo.svg?raw=true">
66
</a><br><br>
77
A modern date range picker component for React using Tailwind 3 and dayjs. Alternative to Litepie Datepicker which uses Vuejs.
88
</p>
99

10-
<div align="center">
10+
<div style="text-align: center">
1111

1212
[![npm version](https://img.shields.io/npm/v/react-tailwindcss-datepicker?style=flat-square)](https://www.npmjs.com/package/react-tailwindcss-datepicker)
1313
[![npm downloads](https://img.shields.io/npm/dt/react-tailwindcss-datepicker?style=flat-square)](https://www.npmjs.com/package/react-tailwindcss-datepicker)
@@ -87,24 +87,24 @@ module.exports = {
8787

8888
Then use react-tailwindcss-select in your app:
8989

90-
```jsx
90+
```tsx
9191
import React, { useState } from "react";
9292
import Datepicker from "react-tailwindcss-datepicker";
9393

9494
const App = () => {
9595
const [value, setValue] = useState({
96-
startDate: new Date(),
97-
endDate: new Date().setMonth(11)
96+
startDate: null,
97+
endDate: null
9898
});
9999

100-
const handleValueChange = newValue => {
101-
console.log("newValue:", newValue);
102-
setValue(newValue);
103-
};
104-
105100
return (
106101
<div>
107-
<Datepicker value={value} onChange={handleValueChange} />
102+
<Datepicker
103+
value={value}
104+
onChange={newValue => {
105+
setValue(newValue);
106+
}}
107+
/>
108108
</div>
109109
);
110110
};

0 commit comments

Comments
 (0)