From ee791f450ca380265fc4a8f11bbb543fe95d643a Mon Sep 17 00:00:00 2001 From: Krishna Ayyalasomayajula Date: Mon, 1 Jun 2026 23:19:25 -0500 Subject: [PATCH] fix: correct button override to spread all props and avoid nested buttons --- mdx-components.tsx | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/mdx-components.tsx b/mdx-components.tsx index 8eae550..750c996 100644 --- a/mdx-components.tsx +++ b/mdx-components.tsx @@ -106,27 +106,10 @@ export function getMDXComponents(components: MDXComponents): MDXComponents { details: (props) =>
, summary: (props) => , - // Buttons (handle onclick string from transformerCopyButton) - button: ({ children, onClick, ...props }: { children?: React.ReactNode; onClick?: string | (() => void); className?: string } & Record) => { - if (typeof onClick === 'string') { - const className = (props.className as string) ?? ''; - return ( - ` - }} - suppressHydrationWarning - /> - ); - } - return ( - - ); - }, + button: ({ children, onClick, ...props }) => ( + typeof onClick === 'string' + ? + ), } }