move _.uniqueId() out of render function
This commit is contained in:
parent
284ab5e628
commit
f1cd5f2d6e
@ -41,6 +41,10 @@ class ActionsDropdown extends Component {
|
||||
this.handlePresentationClick = this.handlePresentationClick.bind(this);
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.uniqueId = _.uniqueId('actions-list-item-');
|
||||
}
|
||||
|
||||
componentWillUpdate(nextProps) {
|
||||
const { isUserPresenter: isPresenter } = nextProps;
|
||||
const { isUserPresenter: wasPresenter, mountModal } = this.props;
|
||||
@ -76,12 +80,12 @@ class ActionsDropdown extends Component {
|
||||
{
|
||||
[
|
||||
(<DropdownListItem
|
||||
key={_.uniqueId('actions-list-item-')}
|
||||
key={this.uniqueId}
|
||||
icon="presentation"
|
||||
label={intl.formatMessage(intlMessages.presentationLabel)}
|
||||
description={intl.formatMessage(intlMessages.presentationDesc)}
|
||||
onClick={this.handlePresentationClick}
|
||||
/>)
|
||||
/>),
|
||||
]
|
||||
}
|
||||
</DropdownList>
|
||||
|
@ -84,6 +84,11 @@ class UserListContent extends Component {
|
||||
this.getDropdownMenuParent = this.getDropdownMenuParent.bind(this);
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
this.title = _.uniqueId('dropdown-title-');
|
||||
this.seperator = _.uniqueId('action-separator-');
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
this.checkDropdownDirection();
|
||||
}
|
||||
@ -286,11 +291,11 @@ class UserListContent extends Component {
|
||||
(
|
||||
<DropdownListTitle
|
||||
description={intl.formatMessage(messages.menuTitleContext)}
|
||||
key={_.uniqueId('dropdown-list-title')}
|
||||
key={this.title}
|
||||
>
|
||||
{user.name}
|
||||
</DropdownListTitle>),
|
||||
(<DropdownListSeparator key={_.uniqueId('action-separator')} />),
|
||||
</DropdownListTitle>),
|
||||
(<DropdownListSeparator key={this.seperator} />),
|
||||
].concat(actions)
|
||||
}
|
||||
</DropdownList>
|
||||
|
Loading…
Reference in New Issue
Block a user