Skip to content

Commit

Permalink
refactor(perf): assign value in if block (#10836)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plumbiu authored Apr 29, 2024
1 parent ca7d421 commit c9c9dff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/normalizeProp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ export function stringifyStyle(
}
for (const key in styles) {
const value = styles[key]
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key)
if (isString(value) || typeof value === 'number') {
const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key)
// only render valid values
ret += `${normalizedKey}:${value};`
}
Expand Down

0 comments on commit c9c9dff

Please sign in to comment.