Skip to content

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

Open
preflower wants to merge 1 commit into
Andarist:mainfrom
preflower:main
Open

fix: Type 'CSSProperties' is not assignable to type 'Style' error#388
preflower wants to merge 1 commit into
Andarist:mainfrom
preflower:main

Conversation

@preflower

@preflower preflower commented Aug 30, 2023

Copy link
Copy Markdown

react-textarea-autosize Style type internal conflict
image
and CSSProperties default supports height property, so I think we can remove union type

@changeset-bot

changeset-bot Bot commented Aug 30, 2023

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e96b50e

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

Copy link
Copy Markdown
Owner

Please share a test case that motivates this change.

@preflower

preflower commented Aug 30, 2023

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Owner

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

@preflower

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Author

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

Copy link
Copy Markdown
Owner

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

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants