diff --git a/CHANGELOG.md b/CHANGELOG.md index 5811a10..79a6e8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,19 +4,18 @@ All notable changes to this project will be documented in this file. See [standa ## [0.2.0](https://github.com/wai-lin/react-hook-pickers/compare/v0.1.2...v0.2.0) (2021-08-08) -### 0.1.2 (2021-08-08) - - ### ⚠ BREAKING CHANGES -* **date-picker-provider:** default configs added in button props generator functions +- **date-picker-provider:** default configs added in button props generator functions ### Features -* **date-picker-provider:** new DatePickerProvider and useDatePickerProvider ([86df656](https://github.com/wai-lin/react-hook-pickers/commit/86df656a8ade6a4871ab5df074bbe845005c8e38)) -* **usedatepicker:** useDatePicker hook for building the datepicker ([0631849](https://github.com/wai-lin/react-hook-pickers/commit/0631849fa2b9fd7053bcf6d447052d04f989d880)) +- **date-picker-provider:** new DatePickerProvider and useDatePickerProvider ([86df656](https://github.com/wai-lin/react-hook-pickers/commit/86df656a8ade6a4871ab5df074bbe845005c8e38)) + +### 0.1.2 (2021-08-08) +- **usedatepicker:** useDatePicker hook for building the datepicker ([0631849](https://github.com/wai-lin/react-hook-pickers/commit/0631849fa2b9fd7053bcf6d447052d04f989d880)) ### Bug Fixes -* **use-date-picker:** goToMonth func subtracting unnecessary 1 month ([530788d](https://github.com/wai-lin/react-hook-pickers/commit/530788d0b673034538317e670e880b050f1e7cc2)) +- **use-date-picker:** goToMonth func subtracting unnecessary 1 month ([530788d](https://github.com/wai-lin/react-hook-pickers/commit/530788d0b673034538317e670e880b050f1e7cc2)) diff --git a/README.md b/README.md index 59efe4f..6e7e734 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,7 @@ import { const ChildComponent = () => { const { + datePickerState, today, getCalendarProps, getCalendarViewControllers, diff --git a/package.json b/package.json index 48c5d36..e4496ef 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "size": "size-limit", "analyze": "size-limit --why", "commit": "git add . && cz", - "release": "standard-version" + "release": "npm run lint && npm run test && npm run build && standard-version" }, "peerDependencies": { "react": ">=16" diff --git a/src/components/DatePickerProvider.tsx b/src/components/DatePickerProvider.tsx index e566ed8..aed41a8 100644 --- a/src/components/DatePickerProvider.tsx +++ b/src/components/DatePickerProvider.tsx @@ -6,7 +6,10 @@ interface DatePickerProviderProps { } const DatePickerContext = React.createContext< - ReturnType | undefined + | ({ datePickerState: ReturnType } & ReturnType< + typeof useDatePicker + >) + | undefined >(undefined) const DatePickerProvider: React.FC = ({ @@ -16,7 +19,9 @@ const DatePickerProvider: React.FC = ({ const datePickerBlocks = useDatePicker(datePickerState) return ( - + {children} )