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


##########
airflow-core/src/airflow/ui/src/components/ui/Pagination/Items.tsx:
##########
@@ -24,13 +24,15 @@ import { Item } from "./Item";
 export const Items = (props: React.HTMLAttributes<HTMLElement>) => (
   <ChakraPagination.Context>
     {({ pages }) =>
-      pages.map((page, index) =>
-        page.type === "ellipsis" ? (
-          <Ellipsis index={index} key={page.type} {...props} />
-        ) : (
-          <Item key={page.value} type="page" value={page.value} {...props} />
-        ),
-      )
+      pages.map((page, index) => {
+        if (page.type === "ellipsis") {
+          const prevVal = (pages[index - 1] as { value: number }).value;
+
+          return <Ellipsis index={index} key={`ellipsis-${prevVal}`} 
{...props} />;

Review Comment:
   Since the ellipsis items genuinely have no stable identifier, I think we use 
index but suppress the lint rule for this specific line. What do you think?



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