Skip to content

Commit 05e9fbc

Browse files
committed
fix: build issue with children
1 parent 0764472 commit 05e9fbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/Code.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function CodePanel({
142142
label?: string
143143
code?: string
144144
}) {
145-
let child = Children.only(children)
145+
let child = Children.toArray(children).find((e) => isValidElement(e));
146146

147147
if (isValidElement(child)) {
148148
const props = child.props as { tag?: string; label?: string; code?: string }

0 commit comments

Comments
 (0)