Skip to content

Commit

Permalink
Changed TextareaAutosizeProps to a TS interface (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist committed Mar 2, 2021
1 parent 90196ef commit 3c71884
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 141 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-yaks-grin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'react-textarea-autosize': patch
---

Changed `TextareaAutosizeProps` to a TS interface which fixes the problem of "resolved" being type alias being inlined in the emitted types declaration which could cause incompatibilities with some versions of `@types/react`.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"./dist/react-textarea-autosize.esm.js": "./dist/react-textarea-autosize.browser.esm.js"
},
"sideEffects": false,
"files": ["dist"],
"files": [
"dist"
],
"author": "Andrey Popp <8mayday@gmail.com> (httsps://andreypopp.com/)",
"contributors": [
"Mateusz Burzyński <mateuszburzynski@gmail.com> (https://github.com/Andarist)"
Expand Down Expand Up @@ -58,7 +60,7 @@
"@babel/preset-typescript": "^7.10.4",
"@changesets/changelog-github": "^0.2.6",
"@changesets/cli": "^2.8.0",
"@preconstruct/cli": "^1.1.14",
"@preconstruct/cli": "^2.0.5",
"@testing-library/jest-dom": "^5.9.0",
"@testing-library/react": "^10.1.0",
"@types/react": "^16.9.35",
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ type Style = Omit<
export type TextareaHeightChangeMeta = {
rowHeight: number;
};
export type TextareaAutosizeProps = Omit<TextareaProps, 'style'> & {
export interface TextareaAutosizeProps extends Omit<TextareaProps, 'style'> {
maxRows?: number;
minRows?: number;
onHeightChange?: (height: number, meta: TextareaHeightChangeMeta) => void;
cacheMeasurements?: boolean;
style?: Style;
};
}

const TextareaAutosize: React.ForwardRefRenderFunction<
HTMLTextAreaElement,
Expand Down
Loading

0 comments on commit 3c71884

Please sign in to comment.