minyeamer commented on PR #66809: URL: https://github.com/apache/airflow/pull/66809#issuecomment-4556231014
@bbovenzi Thanks for the review. Addressed all three: - **`useCallback`**: Understood that `babel-plugin-react-compiler` already handles memoization at build time via `reactCompilerPreset()`, so removed `useCallback` from `initializeMermaid` and `renderDiagram`, and dropped the `useMemo` wrapping the context value. (f328e09d) - **State management**: Understood that `mermaid.initialize()` is cheap enough to call on every `renderDiagram` invocation, so removed the `useState` / `useRef` / `useEffect` tracking chain and the separate `initializeMermaid` function entirely. (f328e09d) - **`extractTextContent`**: Understood that both helpers were only used in one place, so inlined the logic as an `Array.isArray` check with `String()` conversion and removed both functions. (b7cfacd9) --- Drafted-by: Claude Code (claude-sonnet-4-6); reviewed by @minyeamer before posting -- 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]
