jscheffl commented on code in PR #56092:
URL: https://github.com/apache/airflow/pull/56092#discussion_r2380219018


##########
airflow-core/src/airflow/ui/src/components/EditableMarkdownArea.tsx:
##########
@@ -31,36 +32,51 @@ const EditableMarkdownArea = ({
   readonly onBlur?: () => void;
   readonly placeholder?: string | null;
   readonly setMdContent: (value: string) => void;
-}) => (
-  <Box mt={4} px={4} width="100%">
-    <Editable.Root
-      onBlur={onBlur}
-      onChange={(event: ChangeEvent<HTMLInputElement>) => 
setMdContent(event.target.value)}
-      value={mdContent ?? ""}
-    >
-      <Editable.Preview
-        _hover={{ backgroundColor: "transparent" }}
-        alignItems="flex-start"
-        as={VStack}
-        gap="0"
-        overflowY="auto"
-        width="100%"
+}) => {
+  const [currentValue, setCurrentValue] = useState(mdContent ?? "");
+
+  // Sync local state with prop changes
+  useEffect(() => {
+    setCurrentValue(mdContent ?? "");
+  }, [mdContent]);

Review Comment:
   useEffect should only be used where needed. Can you please make a solution 
without?



-- 
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