Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Fix react error missing key
Browse files Browse the repository at this point in the history
  • Loading branch information
mjcuva committed Aug 9, 2018
1 parent e59eb58 commit 3fac3d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/api-explorer/dist/index.js

Large diffs are not rendered by default.

26 changes: 14 additions & 12 deletions packages/api-explorer/src/block-types/Code.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,22 @@ class BlockCode extends React.Component {
)}

<div className="block-code-code">
{codes.map((code, i) => [
<CopyCode code={code.code} />,
// eslint-disable-next-line react/no-array-index-key
<pre key={i} style={{ display: i === this.state.activeTab ? 'block' : 'none' }}>
{codes.map((code, i) => (
<React.Fragment>
<CopyCode code={code.code} />
{
<code
// eslint-disable-next-line
dangerouslySetInnerHTML={{
__html: syntaxHighlighter(code.code, code.language, dark),
}}
/>
// eslint-disable-next-line react/no-array-index-key
<pre key={i} style={{ display: i === this.state.activeTab ? 'block' : 'none' }}>
<code
// eslint-disable-next-line
dangerouslySetInnerHTML={{
__html: syntaxHighlighter(code.code, code.language, dark),
}}
/>
</pre>
}
</pre>,
])}
</React.Fragment>
))}
</div>
</div>
</span>
Expand Down

0 comments on commit 3fac3d7

Please sign in to comment.