Fix key warnings

This commit is contained in:
afc163 2015-10-19 19:27:06 +08:00
parent 1ea1a62d19
commit 7e5630f97d
2 changed files with 5 additions and 5 deletions

View File

@ -60,7 +60,7 @@ InstantClickChangeFns.push(function () {
});
var options = versions.map(function(version) {
var link = versionsHistory[version];
return <option value={version}>{version}</option>;
return <option key={version} value={version}>{version}</option>;
});
function onChange(e) {
if (versionsHistory[e.target.value]) {

View File

@ -77,8 +77,8 @@ let Palette = React.createClass({
let color = this.props.color;
return <div className="color-palette">
<div className="main-color">
{color.colors.map(function(color){
return (<div style={{backgroundColor:color}}></div>);
{color.colors.map(function(color) {
return (<div key={color} style={{backgroundColor:color}}></div>);
})}
</div>
<div className={"color-msg"}>
@ -183,8 +183,8 @@ let ExtendPalettes = React.createClass({
}
];
return <div>
{colors.map((color) => {
return <Palette color={color} />;
{colors.map((color, i) => {
return <Palette key={i} color={color} />;
})}
</div>;
}