guan404ming commented on code in PR #50746:
URL: https://github.com/apache/airflow/pull/50746#discussion_r2113871723


##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/TaskLogContent.tsx:
##########
@@ -17,22 +17,31 @@
  * under the License.
  */
 import { Box, Code, VStack, useToken } from "@chakra-ui/react";
-import type { ReactNode } from "react";
-import { useLayoutEffect } from "react";
+import { useVirtualizer } from "@tanstack/react-virtual";
+import { useLayoutEffect, useRef } from "react";
 
 import { ErrorAlert } from "src/components/ErrorAlert";
 import { ProgressBar } from "src/components/ui";
 
+const EMPTY_ARRAY: Array<JSX.Element | string | undefined> = [];
+
 type Props = {
   readonly error: unknown;
   readonly isLoading: boolean;
   readonly logError: unknown;
-  readonly parsedLogs: ReactNode;
+  readonly parsedLogs: Array<JSX.Element | string | undefined> | undefined;
   readonly wrap: boolean;
 };
 
-export const TaskLogContent = ({ error, isLoading, logError, parsedLogs, wrap 
}: Props) => {
+export const TaskLogContent = ({ error, isLoading, logError, parsedLogs = 
EMPTY_ARRAY, wrap }: Props) => {

Review Comment:
   To use variable is to prevent 
[this](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md)
 but I think the way is not really straightforward. Thus, I change it into not 
accepting undefined here and pass `parsedLogs ?? []`, which is more align to 
our codebase and clear.



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