perf(example): remove unnecessary imports of "prismjs" (#1129)

This commit is contained in:
Mike 2022-07-26 06:45:02 +08:00 committed by GitHub
parent a4b08a10f3
commit 2517d5ab39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,12 +1,10 @@
import Highlight, { defaultProps } from 'prism-react-renderer'
import CopyButton from './CopyButton'
import 'prismjs'
import 'prismjs/components/prism-jsx.min'
import 'prismjs/themes/prism-okaidia.css'
export default function CodePreview({ code, ...props }) {
return (
<Highlight {...defaultProps} className="language-jsx" code={code} language="jsx" theme={undefined}>
<Highlight {...defaultProps} code={code} language="jsx" theme={undefined}>
{({ className, style, tokens, getLineProps, getTokenProps }) => (
// define how each line is to be rendered in the code block,
// position is set to relative so the copy button can align to bottom right