luyangliuable commented on code in PR #42797: URL: https://github.com/apache/airflow/pull/42797#discussion_r1793302191
########## airflow/ui/src/components/SearchBar.tsx: ########## @@ -28,20 +29,16 @@ import { } from "@chakra-ui/react"; import { FiSearch } from "react-icons/fi"; -export const SearchBar = ({ - buttonProps, - groupProps, - inputProps, -}: { - readonly buttonProps?: ButtonProps; - readonly groupProps?: InputGroupProps; - readonly inputProps?: InputProps; -}) => ( +export const SearchBar = forwardRef<HTMLInputElement, { + buttonProps?: ButtonProps; + groupProps?: InputGroupProps; + inputProps?: InputProps; +}>(({ buttonProps, groupProps, inputProps }, ref) => ( Review Comment: Thanks for the suggestion. I refactored the code by moving the debounce logic into the SearchBar component. Inside the SearchBar component, the `onChange` prop is now called within the debounced function, and I removed the unused state as well. -- 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: commits-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org