Fix React.js warning by adding unique "key" prop
This commit is contained in:
@@ -144,8 +144,9 @@ var MainPage = React.createClass({
|
|||||||
var handleNotificationClick = function() {
|
var handleNotificationClick = function() {
|
||||||
thisObj.handleSelect(index);
|
thisObj.handleSelect(index);
|
||||||
}
|
}
|
||||||
return (<MattermostView id={ 'mattermostView' + index } style={ thisObj.visibleStyle(thisObj.state.key === index) } src={ team.url } name={ team.name } onUnreadCountChange={ handleUnreadCountChange } onNotificationClick={ handleNotificationClick }
|
var id = 'mattermostView' + index;
|
||||||
/>)
|
return (<MattermostView key={ id } id={ id } style={ thisObj.visibleStyle(thisObj.state.key === index) } src={ team.url } name={ team.name } onUnreadCountChange={ handleUnreadCountChange }
|
||||||
|
onNotificationClick={ handleNotificationClick } />)
|
||||||
});
|
});
|
||||||
var views_row = (<Row>
|
var views_row = (<Row>
|
||||||
{ views }
|
{ views }
|
||||||
@@ -189,7 +190,8 @@ var TabBar = React.createClass({
|
|||||||
•
|
•
|
||||||
</Badge>);
|
</Badge>);
|
||||||
}
|
}
|
||||||
return (<NavItem className="teamTabItem" id={ 'teamTabItem' + index } eventKey={ index }>
|
var id = 'teamTabItem' + index;
|
||||||
|
return (<NavItem className="teamTabItem" key={ id } id={ id } eventKey={ index }>
|
||||||
{ team.name }
|
{ team.name }
|
||||||
{ ' ' }
|
{ ' ' }
|
||||||
{ badge }
|
{ badge }
|
||||||
|
Reference in New Issue
Block a user