From 9783a08a8fa674ebdba97ea0c4621ac929f2ddd7 Mon Sep 17 00:00:00 2001 From: Shota Fuji Date: Mon, 8 Aug 2022 12:51:42 +0000 Subject: [PATCH] fix(components): Fix copy button copies outdated snippet https://github.com/storybookjs/storybook/issues/18829 Fixed a regression introduced in 5f5cf81060afb6124b1f2382accbe2b2e7a47003. `highlightableCode` was missing in dependencies array therefore the copied code snippet was fixed to the first-rendered one. --- code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx b/code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx index 340c72a62b2e..0ccce7405576 100644 --- a/code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx +++ b/code/lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx @@ -177,7 +177,7 @@ export const SyntaxHighlighter: FC = ({ }) .catch(logger.error); }, - [] + [highlightableCode] ); return (