Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed TextareaAutosizeProps to a TS interface #311

Merged
merged 1 commit into from
Mar 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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