Skip to content

Commit

Permalink
Added props.metastring support for newer react versions (docusaurus 3) (
Browse files Browse the repository at this point in the history
#151)

keeps backwards compatibility with older react and docusaurus 2
  • Loading branch information
gtnardy authored Oct 9, 2024
1 parent 598cb5b commit 650f400
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/theme/CodeBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import type { ReferenceCodeBlockProps } from '../types'

const componentWrapper = (Component: typeof CodeBlock) => {
const WrappedComponent = (props: ReferenceCodeBlockProps) => {
if (props.reference) {
if (props.reference || props.metastring?.split(' ').includes('reference')) {
return (
<ReferenceCodeBlock {...props} />
);
Expand Down

0 comments on commit 650f400

Please sign in to comment.