diff --git a/types/react-input-autosize/index.d.ts b/types/react-input-autosize/index.d.ts index 41782e482a..486fef4491 100644 --- a/types/react-input-autosize/index.d.ts +++ b/types/react-input-autosize/index.d.ts @@ -9,7 +9,7 @@ import * as React from 'react'; export interface AutosizeInputProps extends React.InputHTMLAttributes, React.ClassAttributes { inputClassName?: string; - inputRef?: React.Ref; + inputRef?: (instance: HTMLInputElement | null) => void; inputStyle?: React.CSSProperties; minWidth?: string | number; onAutosize?: (inputWidth: string | number) => void; diff --git a/types/react-input-autosize/react-input-autosize-tests.tsx b/types/react-input-autosize/react-input-autosize-tests.tsx index d67da978cf..204922a8de 100644 --- a/types/react-input-autosize/react-input-autosize-tests.tsx +++ b/types/react-input-autosize/react-input-autosize-tests.tsx @@ -2,10 +2,10 @@ import * as React from 'react'; import AutosizeInput, { AutosizeInputProps } from 'react-input-autosize'; class Test extends React.Component { - input: HTMLInputElement; + input: HTMLInputElement | null = null; auto: AutosizeInput; - inputRef = (ref: HTMLInputElement) => { + inputRef = (ref: HTMLInputElement | null) => { this.input = ref; }