bbovenzi commented on code in PR #77554:
URL: https://github.com/apache/airflow/pull/77554#discussion_r4697416145


##########
airflow-core/src/airflow/ui/src/queries/useNoteEditor.ts:
##########
@@ -34,6 +34,10 @@ export const useNoteEditor = ({
 }) => {
   const [note, setNote] = useState<string | null>(savedNote);
 
+  // The hook survives navigation between entities, so keep the editable draft
+  // aligned with the newly selected entity's server-backed note.
+  useEffect(() => setNote(savedNote), [savedNote]);

Review Comment:
   This is an improper use of useEffect. We can do the same by keeping a 
`savedNote` param that is passed to this hook to keep track of the note saved 
to the db.



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