Guard against no children
This commit is contained in:
parent
1e9a2e80e9
commit
71a119376c
1 changed files with 3 additions and 0 deletions
|
@ -114,6 +114,9 @@ export default class Dropdown extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
if (!nextProps.children || nextProps.children.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this._reindexChildren(nextProps.children);
|
this._reindexChildren(nextProps.children);
|
||||||
const firstChild = nextProps.children[0];
|
const firstChild = nextProps.children[0];
|
||||||
this.setState({
|
this.setState({
|
||||||
|
|
Loading…
Reference in a new issue