diff --git a/.changeset/long-seals-relax.md b/.changeset/long-seals-relax.md new file mode 100644 index 00000000..687b2784 --- /dev/null +++ b/.changeset/long-seals-relax.md @@ -0,0 +1,6 @@ +--- +'react-textarea-autosize': patch +--- + +- Removed props.style.height from `TextareaAutosizeProps`'s `style` prop. +- `TextareaAutosizeProps` now extends from `React.TextareaHTMLAttributes` instead of `JSX.IntrinsicElements['textarea']` to avoid problems with `ref` attribute. diff --git a/src/index.tsx b/src/index.tsx index aa67442d..1c80f6b3 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -6,12 +6,12 @@ import { noop } from './utils'; type Style = Omit< NonNullable, - 'maxHeight' | 'minHeight' -> & { - height?: number; -}; + 'maxHeight' | 'minHeight' | 'height' +>; -export type TextareaAutosizeProps = JSX.IntrinsicElements['textarea'] & { +export type TextareaAutosizeProps = React.TextareaHTMLAttributes< + HTMLTextAreaElement +> & { maxRows?: number; minRows?: number; onHeightChange?: (height: number) => void;