diff --git a/src/components/Code.tsx b/src/components/Code.tsx index bba1f91..aab9103 100644 --- a/src/components/Code.tsx +++ b/src/components/Code.tsx @@ -142,7 +142,7 @@ function CodePanel({ label?: string code?: string }) { - let child = Children.only(children) + let child = Children.toArray(children).find((e) => isValidElement(e)); if (isValidElement(child)) { const props = child.props as { tag?: string; label?: string; code?: string }