Skip to content

Commit

Permalink
Merge 2fe08ad into aaa405e
Browse files Browse the repository at this point in the history
  • Loading branch information
penwa committed Mar 29, 2021
2 parents aaa405e + 2fe08ad commit b9a1f1e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/nerv/src/create-element.ts
Expand Up @@ -7,7 +7,8 @@ import {
Props,
VNode,
VirtualChildren,
EMPTY_CHILDREN
EMPTY_CHILDREN,
isNullOrUndef
} from 'nerv-shared'
import SVGPropertyConfig from './vdom/svg-property-config'
import Component from './component'
Expand All @@ -16,8 +17,8 @@ function transformPropsForRealTag (type: string, props: Props) {
const newProps: Props = {}
for (const propName in props) {
const propValue = props[propName]
if (propName === 'defaultValue') {
newProps.value = props.value || props.defaultValue
if (propName === 'defaultValue' && isNullOrUndef(props.value)) {
newProps.value = props.defaultValue
continue
}
const svgPropName = SVGPropertyConfig.DOMAttributeNames[propName]
Expand Down

0 comments on commit b9a1f1e

Please sign in to comment.