Skip to content

Commit 589ea9d

Browse files
authored
Merge pull request #2 from NoahMLoomis/bugfix/types-mismatch
Changed types of `value` and `onChange` to be the same.
2 parents 9499784 + 2a4536c commit 589ea9d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# dependencies
44
node_modules
5+
package-lock.json
6+
yarn.lock
57

68
# test coverage
79
coverage

src/components/Datepicker.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import DatepickerContext from "../contexts/DatepickerContext";
1414
interface Props {
1515
primaryColor?: string,
1616
value: {
17-
startDate: Date | string,
18-
endDate: Date | string
17+
startDate: string | Date,
18+
endDate: string | Date
1919
} | null,
20-
onChange: (value: {startDate: string | null, endDate: string | null}) => void,
20+
onChange: (value: {startDate: string | Date, endDate: string | Date} | null) => void,
2121
useRange?: boolean,
2222
showFooter?: boolean,
2323
showShortcuts?: boolean,

src/contexts/DatepickerContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface DatepickerStore {
1515
inputText: string,
1616
changeInputText: (text: string) => void,
1717
updateFirstDate: (date: dayjs.Dayjs) => void,
18-
changeDatepickerValue: (value: {startDate: string | null, endDate: string | null}) => void,
18+
changeDatepickerValue: (value: {startDate: string | Date, endDate: string | Date} | null) => void,
1919
showFooter?: boolean,
2020
placeholder?: string | null,
2121
separator?: string,

0 commit comments

Comments
 (0)