Skip to content

Commit dbf3885

Browse files
authored
fix: (potential) workaround for transpiler's error (#1221)
Currently the below part: ```js const { text } = props; ... navigator.clipboard.writeText(text) ``` is transpiled like the below (`props.value` is used instead of `props.text`) <img width="768" height="319" alt="Screenshot 2025-10-31 at 10 46 46" src="https://github.com/user-attachments/assets/22a870f1-c547-4aa1-ab14-3f6bcb84bbc9" /> and it causes copying of 'undefined' text (ref https://x.com/JLarky/status/1984050194896580874 ) This PR tries to fix it by avoiding using destructuring syntax.
1 parent afcbc21 commit dbf3885

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

frontend/islands/CopyButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function CopyButton(props: CopyButtonProps) {
1313
const timer = useRef<number | null>(null);
1414
const copied = useSignal(false);
1515

16-
const { text } = props;
16+
const text = props.text;
1717

1818
const copy = useCallback(() => {
1919
navigator.clipboard.writeText(text).then(() => {

0 commit comments

Comments
 (0)