bito-code-review[bot] commented on PR #41244:
URL: https://github.com/apache/superset/pull/41244#issuecomment-4751385445
<!-- Bito Reply -->
The suggestion to replace `any` with a concrete type is valid, as it
improves type safety for the row-mapping callback. You can resolve this by
using the generic type `T` already defined in the `ListView` component, which
represents the row data type.
To implement this, update the `map` and `filter` callbacks to use `T`
instead of `any`:
```typescript
// Replace (r: any) with (r: Row<T>)
!action.hidden?.(selectedFlatRows.map((r: Row<T>) => r.original)),
// ...
action.onSelect(selectedFlatRows.map((r: Row<T>) => r.original))
```
Note: You may need to import `Row` from `react-table` if it is not already
available in the scope. There are no other comments on this PR to address.
**superset-frontend/src/components/ListView/ListView.tsx**
```
!action.hidden?.(
selectedFlatRows.map((r: Row<T>) => r.original),
),
// ...
onClick={() =>
action.onSelect(
selectedFlatRows.map((r: Row<T>) => r.original),
)
}
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]