fix: type error on pre component children.props access

This commit is contained in:
Usman Baig
2026-03-29 01:09:30 +01:00
parent b1ed7518b1
commit 6c73fd1dbc

View File

@@ -19,12 +19,9 @@ import { IntegrationGuide } from '@/components/IntegrationGuide'
// * ─── MDX Components ──────────────────────────────────────────── // * ─── MDX Components ────────────────────────────────────────────
// rehype-mdx-code-props passes meta (e.g. filename="app.tsx") as props // rehype-mdx-code-props passes meta (e.g. filename="app.tsx") as props
// on the <pre> element. We intercept <pre> to extract filename and render CodeBlock. // on the <pre> element. We intercept <pre> to extract filename and render CodeBlock.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const mdxComponents = { const mdxComponents = {
pre: ({ children, filename, ...props }: { pre: ({ children, filename, ...props }: any) => {
children: React.ReactElement
filename?: string
[key: string]: unknown
}) => {
const code = children?.props?.children const code = children?.props?.children
if (typeof code === 'string') { if (typeof code === 'string') {
return ( return (