From f7da5be00e9e930511db3c313b8ee6046d6c58b1 Mon Sep 17 00:00:00 2001 From: Gabriel Tanasovici Nardy Date: Mon, 7 Oct 2024 10:19:30 -0300 Subject: [PATCH] Added props.metastring support for newer react versions (docusaurus 3) keeps backwards compatibility with older react and docusaurus 2 --- src/theme/CodeBlock/index.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/theme/CodeBlock/index.tsx b/src/theme/CodeBlock/index.tsx index dbd5bb5..6838bdc 100644 --- a/src/theme/CodeBlock/index.tsx +++ b/src/theme/CodeBlock/index.tsx @@ -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 ( );