From dce45b7f5230fba73dbc92bbb3e6be058ce0cef1 Mon Sep 17 00:00:00 2001 From: doniyor2109 Date: Tue, 18 Jun 2019 22:05:17 +0500 Subject: [PATCH] React flatpickr/add render prop (#36215) * Add render prop to DateTimePickerProps This prop was added in v3.8.0 version of react-flatpickr https://github.com/haoxins/react-flatpickr/releases/tag/v3.8.0. Render prop was added in this PR https://github.com/haoxins/react-flatpickr/pull/90 * Add contributor name * Fix lint errors * Bump version to 3.8 --- types/react-flatpickr/index.d.ts | 6 ++++-- types/react-flatpickr/react-flatpickr-tests.tsx | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/types/react-flatpickr/index.d.ts b/types/react-flatpickr/index.d.ts index 9d070494b4..ac470b8f64 100644 --- a/types/react-flatpickr/index.d.ts +++ b/types/react-flatpickr/index.d.ts @@ -1,12 +1,13 @@ -// Type definitions for react-flatpickr 3.7 +// Type definitions for react-flatpickr 3.8 // Project: https://github.com/coderhaoxin/react-flatpickr // Definitions by: begincalendar // snaveevans // rigothedev +// doniyor2109 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 -import { Component } from "react"; +import { Component, ReactElement } from "react"; import flatpickr from "flatpickr"; export type Omit = Pick>; @@ -24,6 +25,7 @@ export interface DateTimePickerProps extends Omit, 'va onDayCreate?: flatpickr.Options.Hook; value?: string | Date | number | ReadonlyArray; className?: string; + render?: (props: Omit, ref: (node: HTMLInputElement) => void) => ReactElement; } export default class DatePicker extends Component {} diff --git a/types/react-flatpickr/react-flatpickr-tests.tsx b/types/react-flatpickr/react-flatpickr-tests.tsx index cbad38fd58..1806e4e49e 100644 --- a/types/react-flatpickr/react-flatpickr-tests.tsx +++ b/types/react-flatpickr/react-flatpickr-tests.tsx @@ -42,5 +42,8 @@ const valueDateArrayElement = ( const valueNumberArrayElement = ( ); +const customRender = ( + } /> +); const extraInputPropertiesElement = ;