提交 99f9e59b 编写于 作者: J jim chen

fix TagSelect prop value is an undefined

上级 288169de
...@@ -24,7 +24,7 @@ class TagSelect extends Component { ...@@ -24,7 +24,7 @@ class TagSelect extends Component {
value: this.props.value || this.props.defaultValue || [], value: this.props.value || this.props.defaultValue || [],
}; };
componentWillReceiveProps(nextProps) { componentWillReceiveProps(nextProps) {
if ('value' in nextProps) { if ('value' in nextProps && nextProps.value) {
this.setState({ value: nextProps.value }); this.setState({ value: nextProps.value });
} }
} }
...@@ -53,7 +53,7 @@ class TagSelect extends Component { ...@@ -53,7 +53,7 @@ class TagSelect extends Component {
const checkedTags = children const checkedTags = children
.filter(child => this.isTagSelectOption(child)) .filter(child => this.isTagSelectOption(child))
.map(child => child.props.value); .map(child => child.props.value);
return checkedTags; return checkedTags || [];
} }
handleTagChange = (value, checked) => { handleTagChange = (value, checked) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册