Skip to content

Commit

Permalink
fix(taro-tt): 头条小程序中 props 为 null 时也使用 defaultProps
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Dec 10, 2018
1 parent 8350ab6 commit 011e90a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/taro-tt/src/create-component.js
Expand Up @@ -174,7 +174,7 @@ function filterProps (properties, defaultProps = {}, componentProps = {}, weappC
}
if (!isEmptyObject(defaultProps)) {
for (const propName in defaultProps) {
if (newProps[propName] === undefined) {
if (newProps[propName] === undefined || newProps[propName] === null) {
newProps[propName] = defaultProps[propName]
}
}
Expand Down

0 comments on commit 011e90a

Please sign in to comment.