Skip to content

Commit 650f400

Browse files
authored
Added props.metastring support for newer react versions (docusaurus 3) (#151)
keeps backwards compatibility with older react and docusaurus 2
1 parent 598cb5b commit 650f400

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/theme/CodeBlock/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type { ReferenceCodeBlockProps } from '../types'
1313

1414
const componentWrapper = (Component: typeof CodeBlock) => {
1515
const WrappedComponent = (props: ReferenceCodeBlockProps) => {
16-
if (props.reference) {
16+
if (props.reference || props.metastring?.split(' ').includes('reference')) {
1717
return (
1818
<ReferenceCodeBlock {...props} />
1919
);

0 commit comments

Comments
 (0)