bbovenzi commented on code in PR #54825:
URL: https://github.com/apache/airflow/pull/54825#discussion_r2301915461
##########
airflow-core/src/airflow/ui/src/components/DateTimeInput.tsx:
##########
@@ -20,39 +20,67 @@ import { Input, type InputProps } from "@chakra-ui/react";
import dayjs from "dayjs";
import tz from "dayjs/plugin/timezone";
import { forwardRef } from "react";
+import DatePicker from "react-datepicker";
+import "react-datepicker/dist/react-datepicker.css";
import { useTimezone } from "src/context/timezone";
dayjs.extend(tz);
-type Props = {
- readonly value: string;
-} & InputProps;
+// We define the custom input component outside of the main component to
prevent re-renders.
+const CustomInput = forwardRef<HTMLInputElement, InputProps>(({ onClick,
value, ...rest }, ref) => (
+ <Input {...rest} onClick={onClick} ref={ref} value={value} />
+));
-export const DateTimeInput = forwardRef<HTMLInputElement, Props>(({ onChange,
value, ...rest }, ref) => {
+CustomInput.displayName = "CustomInput";
Review Comment:
Why are we customizing this?
--
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]