Skip to content

Commit 3c71884

Browse files
authored
Changed TextareaAutosizeProps to a TS interface (Andarist#311)
1 parent 90196ef commit 3c71884

File tree

4 files changed

+458
-141
lines changed

4 files changed

+458
-141
lines changed

.changeset/purple-yaks-grin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-textarea-autosize': patch
3+
---
4+
5+
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`.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
"./dist/react-textarea-autosize.esm.js": "./dist/react-textarea-autosize.browser.esm.js"
2222
},
2323
"sideEffects": false,
24-
"files": ["dist"],
24+
"files": [
25+
"dist"
26+
],
2527
"author": "Andrey Popp <[email protected]> (httsps://andreypopp.com/)",
2628
"contributors": [
2729
"Mateusz Burzyński <[email protected]> (https://github.com/Andarist)"
@@ -58,7 +60,7 @@
5860
"@babel/preset-typescript": "^7.10.4",
5961
"@changesets/changelog-github": "^0.2.6",
6062
"@changesets/cli": "^2.8.0",
61-
"@preconstruct/cli": "^1.1.14",
63+
"@preconstruct/cli": "^2.0.5",
6264
"@testing-library/jest-dom": "^5.9.0",
6365
"@testing-library/react": "^10.1.0",
6466
"@types/react": "^16.9.35",

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ type Style = Omit<
1616
export type TextareaHeightChangeMeta = {
1717
rowHeight: number;
1818
};
19-
export type TextareaAutosizeProps = Omit<TextareaProps, 'style'> & {
19+
export interface TextareaAutosizeProps extends Omit<TextareaProps, 'style'> {
2020
maxRows?: number;
2121
minRows?: number;
2222
onHeightChange?: (height: number, meta: TextareaHeightChangeMeta) => void;
2323
cacheMeasurements?: boolean;
2424
style?: Style;
25-
};
25+
}
2626

2727
const TextareaAutosize: React.ForwardRefRenderFunction<
2828
HTMLTextAreaElement,

0 commit comments

Comments
 (0)