Skip to content

Commit

Permalink
Add unique keys to generated JSX elements in Result.jsx
Browse files Browse the repository at this point in the history
- Modified `Result.jsx` to include unique keys in JSX elements.
- Wrapped `otherLines` array items with a `<p>` tag.

Improves React's performance by providing unique identifiers to help with
the rendering process and avoid potential key duplication issues. 🛠️
  • Loading branch information
horta committed Oct 26, 2024
1 parent a9506cd commit f08e856
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/components/Result.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ const Result = () => {
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-target`} className="alignment-line">{ formattedTargetLine }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-alignment`} className="alignment-line">{ alignmentLine }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-query`} className="alignment-line">{ formattedQueryLine }</p>);
outputLines.push(otherLines[0]);
outputLines.push(otherLines[1]);
outputLines.push(otherLines[2]);
outputLines.push(otherLines[3]);
outputLines.push(otherLines[4]);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-residue0`} className="alignment-line">{ otherLines[0] }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-residue1`} className="alignment-line">{ otherLines[1] }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-residue2`} className="alignment-line">{ otherLines[2] }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-residue3`} className="alignment-line">{ otherLines[3] }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-residue4`} className="alignment-line">{ otherLines[4] }</p>);
outputLines.push(<p key={`matches-${m}-alignmemt-${a}-pp`} className="alignment-line">{ppLine}</p>);
outputLines.push(<React.Fragment key={`matches-${m}-alignmemt-${a}-brs`}><br/><br/></React.Fragment>);
});
Expand Down

0 comments on commit f08e856

Please sign in to comment.