From e46d02c1cc096e049d7a8883dbb9b160181b6c6c Mon Sep 17 00:00:00 2001 From: dprevoznik <58714078+dprevoznik@users.noreply.github.com> Date: Fri, 21 Aug 2026 16:22:15 +0000 Subject: [PATCH] Fix CopyPromptButton crashing when rendered with no props with no attributes passes null props under the classic JSX transform, and destructuring defaults only apply to undefined, not null, so the homepage's default-prompt usage broke while the parameterized usage on the Foreman page kept working. --- snippets/copy-prompt-button.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/copy-prompt-button.jsx b/snippets/copy-prompt-button.jsx index 8be5fee..5092c4b 100644 --- a/snippets/copy-prompt-button.jsx +++ b/snippets/copy-prompt-button.jsx @@ -27,7 +27,8 @@ const DEFAULT_PROMPT = `# Setup Kernel - Tell the user they can use the live view immediately. - If browser creation fails, stop and ask the user for help.`; -export const CopyPromptButton = ({ prompt = DEFAULT_PROMPT, label = 'copy prompt' } = {}) => { +export const CopyPromptButton = (props) => { + const { prompt = DEFAULT_PROMPT, label = 'copy prompt' } = props || {}; const [copied, setCopied] = useState(false); const handleCopy = useCallback(async () => {