Skip to content

Commit

Permalink
Fix Each child in an array or iterator should have a unique "key" prop
Browse files Browse the repository at this point in the history
  • Loading branch information
OrkunKocyigit authored Jul 14, 2019
1 parent 96cc9f1 commit f875901
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/changelog.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ var {Button} = require('react-bootstrap');
const text = buttonText.replace('{step}', step);

return [
<ul {...(className ? {className: className} : {})}>
<ul key={"changelog-ul"} {...(className ? {className: className} : {})}>
{children.slice(start, length)}
</ul>,
<Button variant="link" onClick={this.handleClick}
<Button key={"changelog-button"} variant="link" onClick={this.handleClick}
{...(length >= children.length ? {disabled: 'true'} : {})}>
{text}
</Button>
Expand Down
11 changes: 6 additions & 5 deletions src/profile.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ var Profile = CreateClass({
[

<TextWithTooltip tooltip={intl.translate("残HP割合説明(ジータのみ)", locale)}
key={"remainHP"}
id={"tooltip-remain-hp-djeeta-detail"}>
<tr>
<th className="bg-primary">
Expand Down Expand Up @@ -655,7 +656,7 @@ var Profile = CreateClass({

{this.state.openLBlist ?
[
<TextWithTooltip tooltip={intl.translate("LB 属性攻撃の説明", locale)} id={"tooltip-critical-zenith-detail"}>
<TextWithTooltip tooltip={intl.translate("LB 属性攻撃の説明", locale)} id={"tooltip-critical-zenith-detail"} key={"zenithElementBonus"}>
<tr>
<th className="bg-primary">{intl.translate("LB 属性攻撃", locale)}</th>
<td><FormControl componentClass="select" value={this.state.zenithElementBonus}
Expand All @@ -664,7 +665,7 @@ var Profile = CreateClass({
</tr>
</TextWithTooltip>,

<TextWithTooltip tooltip={intl.translate("LB チェンバの説明", locale)} id={"tooltip-chaindamage-zenith-detail"}>
<TextWithTooltip tooltip={intl.translate("LB チェンバの説明", locale)} id={"tooltip-chaindamage-zenith-detail"} key={"zenithChainDamageBonus"}>
<tr>
<th className="bg-primary">{intl.translate("LB チェンバ", locale)}</th>
<td><FormControl componentClass="select" value={this.state.zenithChainDamageBonus}
Expand All @@ -673,7 +674,7 @@ var Profile = CreateClass({
</tr>
</TextWithTooltip>,

<TextWithTooltip tooltip={intl.translate("LB チェンバ上限の説明", locale)} id={"tooltip-chaindamagelimit-zenith-detail"}>
<TextWithTooltip tooltip={intl.translate("LB チェンバ上限の説明", locale)} id={"tooltip-chaindamagelimit-zenith-detail"} key={"zenithChainDamageLimitBonus"}>
<tr>
<th className="bg-primary">{intl.translate("LB チェンバ上限", locale)}</th>
<td><FormControl componentClass="select" value={this.state.zenithChainDamageLimitBonus}
Expand All @@ -682,7 +683,7 @@ var Profile = CreateClass({
</tr>
</TextWithTooltip>,

<TextWithTooltip tooltip={intl.translate("得意武器攻撃の説明", locale)} id={"tooltip-weapon-zenith-detail"}>
<TextWithTooltip tooltip={intl.translate("得意武器攻撃の説明", locale)} id={"tooltip-weapon-zenith-detail"} key={"zenithBonus1"}>
<tr>
<th className="bg-primary">
{intl.translate("得意武器攻撃1", locale)}({intl.translate(armTypes[Jobs[this.state.job].favArm1], locale)})
Expand All @@ -693,7 +694,7 @@ var Profile = CreateClass({
</tr>
</TextWithTooltip>,

<TextWithTooltip tooltip={intl.translate("得意武器攻撃の説明", locale)} id={"tooltip-weapon-zenith-detail"}>
<TextWithTooltip tooltip={intl.translate("得意武器攻撃の説明", locale)} id={"tooltip-weapon-zenith-detail"} key={"zenithBonus2"}>
<tr>
<th className="bg-primary">
{intl.translate("得意武器攻撃2", locale)}({intl.translate(armTypes[Jobs[this.state.job].favArm2], locale)})
Expand Down
2 changes: 1 addition & 1 deletion src/result.js
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ var Result = CreateClass({

for (var key in charaDetail) {
if (charaDetail[key].length > 0) {
res.push(<tr>
res.push(<tr key={"chara-result-" + key}>
<td colSpan="3">
<span className="text-info">{key}</span>
</td>
Expand Down

0 comments on commit f875901

Please sign in to comment.