Andarist / react-textarea-autosize

<textarea /> component for React which grows with content
http://andarist.github.io/react-textarea-autosize/
MIT License
2.18k stars 244 forks source link

fix: Type 'CSSProperties' is not assignable to type 'Style' error #388

Open preflower opened 10 months ago

preflower commented 10 months ago

react-textarea-autosize Style type internal conflict

image

and CSSProperties default supports height property, so I think we can remove union type

changeset-bot[bot] commented 10 months ago

⚠️ No Changeset found

Latest commit: e96b50ec9cea38fd6c88c23a1752ac59f9b5ca47

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Andarist commented 10 months ago

Please share a test case that motivates this change.

preflower commented 10 months ago

Please share a test case that motivates this change.

This is a type error, I can't provide a test case, or do you want a minimal reproducible code repo?

Andarist commented 10 months ago

Yes, a sample code that errors but shouldn't (or the other way around).

preflower commented 10 months ago

just because I try to set height is string type; Here is a mini repo: https://stackblitz.com/edit/vite-react-ts-dwvju5?file=src%2FApp.tsx

preflower commented 10 months ago

just because I try to set height is string type; Here is a mini repo: stackblitz.com/edit/vite-react-ts-dwvju5?file=src%2FApp.tsx

Although height should not be applied in react-textarea-autosize component...should use minRow and maxRow instead of it.

Andarist commented 10 months ago

Although height should not be applied in react-textarea-autosize component...should use minRow and maxRow instead of it.

☝️ this. height is only there to aid with SSR scenarios when we can't measure the DOM.

preflower commented 10 months ago

Although height should not be applied in react-textarea-autosize component...should use minRow and maxRow instead of it.

☝️ this. height is only there to aid with SSR scenarios when we can't measure the DOM.

Yeah, but current height only support number type, it also should be support string type