AchimGaedkeLynker commented on code in PR #34904:
URL: https://github.com/apache/airflow/pull/34904#discussion_r1445481835


##########
airflow/www/static/js/components/Clipboard.tsx:
##########
@@ -43,9 +43,13 @@ export const ClipboardButton = forwardRef(
     },
     ref
   ) => {
-    const { hasCopied, onCopy } = useClipboard(value);
+    const { setValue, hasCopied, onCopy } = useClipboard(value);
     const containerRef = useContainerRef();
 
+    useEffect(() => {
+      setValue(value);

Review Comment:
   After reading 
https://stackoverflow.com/questions/41322523/reactjs-calling-setstate-with-same-parameter
 carefully, I believe this is not necessary, as same values do not trigger a 
state change event.
   
   Would this unblock the pullrequest - allowing to close #34846 ?
   



##########
airflow/www/static/js/components/Clipboard.tsx:
##########
@@ -43,9 +43,13 @@ export const ClipboardButton = forwardRef(
     },
     ref
   ) => {
-    const { hasCopied, onCopy } = useClipboard(value);
+    const { setValue, hasCopied, onCopy } = useClipboard(value);
     const containerRef = useContainerRef();
 
+    useEffect(() => {
+      setValue(value);

Review Comment:
   After reading 
https://stackoverflow.com/questions/41322523/reactjs-calling-setstate-with-same-parameter
 carefully, I believe this is not necessary, as same values do not trigger a 
state change event.
   
   Would this unblock the pull request - allowing to close #34846 ?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to