Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(website): react key error on internal pages of website #9506

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"konamimojisplosion": "^0.5.2",
"lz-string": "^1.5.0",
"prettier": "^3.2.5",
"prism-react-renderer": "^1.3.5",
"prism-react-renderer": "^2.3.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-resizable-panels": "^0.0.63",
Expand Down
10 changes: 2 additions & 8 deletions packages/website/src/theme/CodeBlock/Content/String.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ import Line from '@theme/CodeBlock/Line';
import WordWrapButton from '@theme/CodeBlock/WordWrapButton';
import clsx from 'clsx';
import * as lz from 'lz-string';
import type { Language } from 'prism-react-renderer';
import Highlight, { defaultProps } from 'prism-react-renderer';
import { Highlight } from 'prism-react-renderer';
import React from 'react';

import { TryInPlayground } from '../../MDXComponents/TryInPlayground';
Expand Down Expand Up @@ -75,12 +74,7 @@ export default function CodeBlockString({
>
{title && <div className={styles.codeBlockTitle}>{title}</div>}
<div className={styles.codeBlockContent}>
<Highlight
{...defaultProps}
theme={prismTheme}
code={code}
language={(language ?? 'text') as Language}
>
<Highlight theme={prismTheme} code={code} language={language ?? 'text'}>
{({
className,
tokens,
Expand Down
13 changes: 2 additions & 11 deletions yarn.lock
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Praise] Always great to see a deduplication 😄 nice!

Original file line number Diff line number Diff line change
Expand Up @@ -16905,16 +16905,7 @@ __metadata:
languageName: node
linkType: hard

"prism-react-renderer@npm:^1.3.5":
version: 1.3.5
resolution: "prism-react-renderer@npm:1.3.5"
peerDependencies:
react: ">=0.14.9"
checksum: c18806dcbc4c0b4fd6fd15bd06b4f7c0a6da98d93af235c3e970854994eb9b59e23315abb6cfc29e69da26d36709a47e25da85ab27fed81b6812f0a52caf6dfa
languageName: node
linkType: hard

"prism-react-renderer@npm:^2.3.0":
"prism-react-renderer@npm:^2.3.0, prism-react-renderer@npm:^2.3.1":
version: 2.3.1
resolution: "prism-react-renderer@npm:2.3.1"
dependencies:
Expand Down Expand Up @@ -20467,7 +20458,7 @@ __metadata:
mdast-util-mdx: ^3.0.0
monaco-editor: ~0.50.0
prettier: ^3.2.5
prism-react-renderer: ^1.3.5
prism-react-renderer: ^2.3.1
raw-loader: ^4.0.2
react: ^18.2.0
react-dom: ^18.2.0
Expand Down
Loading