Add "key" attribute to suppress warning

This commit is contained in:
Yuya Ochiai
2016-05-02 20:21:51 +09:00
parent 2468d2a6b2
commit 447c84578a

View File

@@ -81,14 +81,15 @@ var SettingsPage = React.createClass({
var options = [];
if (process.platform === 'win32' || process.platform === 'linux') {
options.push(<Input ref="hideMenuBar" type="checkbox" label="Hide Menu Bar (Press Alt to show Menu Bar)" checked={ this.state.hideMenuBar } onChange={ this.handleChangeHideMenuBar } />);
}
if (process.platform === 'darwin') {
options.push(<Input ref="showTrayIcon" type="checkbox" label="Show Icon on Menu Bar (Need to restart the application)" checked={ this.state.showTrayIcon } onChange={ this.handleChangeShowTrayIcon }
options.push(<Input key="inputHideMenuBar" ref="hideMenuBar" type="checkbox" label="Hide Menu Bar (Press Alt to show Menu Bar)" checked={ this.state.hideMenuBar } onChange={ this.handleChangeHideMenuBar }
/>);
}
options.push(<Input ref="disablewebsecurity" type="checkbox" label="Allow insecure contents (This allows not only insecure images, but also insecure scripts)" checked={ this.state.disablewebsecurity }
onChange={ this.handleChangeDisableWebSecurity } />);
if (process.platform === 'darwin') {
options.push(<Input key="inputShowTrayIcon" ref="showTrayIcon" type="checkbox" label="Show Icon on Menu Bar (Need to restart the application)" checked={ this.state.showTrayIcon } onChange={ this.handleChangeShowTrayIcon }
/>);
}
options.push(<Input key="inputDisableWebSecurity" ref="disablewebsecurity" type="checkbox" label="Allow insecure contents (This allows not only insecure images, but also insecure scripts)"
checked={ this.state.disablewebsecurity } onChange={ this.handleChangeDisableWebSecurity } />);
var options_row = (options.length > 0) ? (
<Row>
<Col md={ 12 }>
@@ -133,7 +134,7 @@ var TeamList = React.createClass({
thisObj.handleTeamRemove(i);
};
return (
<TeamListItem index={ i } name={ team.name } url={ team.url } onTeamRemove={ handleTeamRemove } />
<TeamListItem index={ i } key={ "teamListItem" + i } name={ team.name } url={ team.url } onTeamRemove={ handleTeamRemove } />
);
});
return (