bbovenzi commented on code in PR #50746:
URL: https://github.com/apache/airflow/pull/50746#discussion_r2112548487
##########
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:
Why do we need to declare `EMPTY_ARRAY` instead of just `parsedLogs = []`?
--
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]