Skip to content

Commit 0b3743a

Browse files
committed
fix(shared): normalize undefined styles to empty object
1 parent 06051c4 commit 0b3743a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/shared/src/normalizeProp.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { isArray, isString, isObject, hyphenate } from './'
1+
import { EMPTY_OBJ, isArray, isString, isObject, hyphenate } from './'
22
import { isNoUnitNumericStyleProp } from './domAttrConfig'
33

44
export type NormalizedStyle = Record<string, string | number>
@@ -24,6 +24,8 @@ export function normalizeStyle(
2424
return value
2525
} else if (isObject(value)) {
2626
return value
27+
} else if (value == null) {
28+
return EMPTY_OBJ
2729
}
2830
}
2931

0 commit comments

Comments
 (0)