Skip to content

Commit a001a20

Browse files
committed
fix(type): Allow undefined in StyleValue Array
close #7954
1 parent 27e1e38 commit a001a20

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

packages/dts-test/tsx.test-d.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ expectType<JSX.Element>(<div style={[{ color: 'red' }]} />)
1515
expectType<JSX.Element>(
1616
<div style={[{ color: 'red' }, [{ fontSize: '1em' }]]} />
1717
)
18+
expectType<JSX.Element>(
19+
<div style={[undefined, {background: 'green'}]} />
20+
)
1821

1922
// @ts-expect-error unknown prop
2023
;<div foo="bar" />

packages/vue/jsx-runtime/dom.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ interface AriaAttributes {
234234
}
235235

236236
// Vue's style normalization supports nested arrays
237-
export type StyleValue = string | CSSProperties | Array<StyleValue>
237+
export type StyleValue = undefined | string | CSSProperties | Array<StyleValue>
238238

239239
export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
240240
innerHTML?: string

0 commit comments

Comments
 (0)