Skip to content

Commit

Permalink
(docs) fix react warning #410
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 10, 2024
1 parent 7f98fcf commit 6c55e0d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions docs/src/theme/CodeBlock/Line/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export default function CodeBlockLine({
line,
className: clsx(classNames, showLineNumbers && styles.codeLine),
});
const lineTokens = line.map((token, key) => (
<span key={key} {...getTokenProps({token, key})} />
));
const lineTokens = line.map((token, index) => {
const { key, ...props } = getTokenProps({token, key: index});
return <span key={key} {...props} />
});
return (
<span {...lineProps}>
{showLineNumbers ? (
Expand Down

0 comments on commit 6c55e0d

Please sign in to comment.