fix console errors for missing key and invalid prop
This commit is contained in:
parent
737da5937d
commit
aa0f51e62d
@ -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.'
|
||||
|
@ -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')} />),
|
||||
|
Loading…
Reference in New Issue
Block a user