Skip to content

Commit 2303e78

Browse files
idk
1 parent 21c6473 commit 2303e78

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

docs/src/app/(docs)/concepts/auth-security/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ this section we'll go over how to protect different parts of the UploadThing
1414
flow.
1515

1616
<Warning>
17-
Do not protect the entire /api/uploadthing route from being called by
17+
Do not protect the entire `/api/uploadthing` route from being called by
1818
unauthenticated users. The endpoint is called as a webhook by our server and
1919
thus must be publicly available.
2020
</Warning>

docs/src/components/Code.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ function CodePanel({
121121
label?: string;
122122
code?: string;
123123
}) {
124-
let child = React.Children.only(children);
124+
let child: React.ReactElement | null = null;
125+
const childrenCount = React.Children.count(children);
126+
127+
if (childrenCount === 1) {
128+
child = React.Children.only(children) as React.ReactElement;
129+
} else if (childrenCount > 1) {
130+
// If multiple children, take the first one for prop extraction
131+
child = React.Children.toArray(children)[0] as React.ReactElement;
132+
}
125133

126134
if (React.isValidElement(child)) {
127135
tag = (child.props as { tag?: string }).tag ?? tag;

0 commit comments

Comments
 (0)