-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix(types): allow style to be an array in JSX #2947
Conversation
Vue supports array of string and CssProperties in style attribute.
packages/runtime-dom/types/jsx.d.ts
Outdated
@@ -249,7 +249,7 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> { | |||
innerHTML?: string | |||
|
|||
class?: any | |||
style?: string | CSSProperties | |||
style?: string | CSSProperties | Array<string | CSSProperties> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This array can be deeply nested.
type HTMLStyle = string | CSSProperties | Array<HTMLStyle>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@znck WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we support deeply nested styles? Same issue is popping for class
attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue is popping for class attribute
wdym? class
flattens arrays too but is already typed as any
so isn't a problem.
Vue supports array of string and CssProperties in style attribute.