fix console errors for missing key and invalid prop

This commit is contained in:
KDSBrowne 2017-05-01 11:43:01 -07:00
parent 737da5937d
commit aa0f51e62d
2 changed files with 7 additions and 2 deletions

View File

@ -6,10 +6,13 @@ import KEY_CODES from '/imports/utils/keyCodes';
import ListItem from './item/component';
import ListSeparator from './separator/component';
import ListTitle from './title/component';
const propTypes = {
children: PropTypes.arrayOf((propValue, key, componentName, location, propFullName) => {
if (propValue[key].type !== ListItem && propValue[key].type !== ListSeparator) {
if (propValue[key].type !== ListItem &&
propValue[key].type !== ListSeparator &&
propValue[key].type !== ListTitle) {
return new Error(
'Invalid prop `' + propFullName + '` supplied to' +
' `' + componentName + '`. Validation failed.'

View File

@ -286,8 +286,10 @@ class UserListItem extends Component {
<DropdownList>
{
[
(<DropdownListSeparator key={_.uniqueId('action-separator')} />),
(<DropdownListTitle
description={intl.formatMessage(messages.menuTitleContext)}>
description={intl.formatMessage(messages.menuTitleContext)}
key={_.uniqueId('dropdown-list-title')}>
{user.name}
</DropdownListTitle>),
(<DropdownListSeparator key={_.uniqueId('action-separator')} />),