mirror of
https://github.com/nowcommunity/nowdatabase.git
synced 2026-10-12 19:13:52 +03:00
Fix typescript errors tableview
This commit is contained in:
@@ -14,13 +14,13 @@ export const ActionComponent = <T extends MRT_RowData>({
|
||||
selectorFn,
|
||||
}: {
|
||||
row: MRT_Row<T>
|
||||
idFieldName: keyof T
|
||||
idFieldName?: keyof T
|
||||
checkRowRestriction: ((row: T) => boolean) | undefined
|
||||
url: string | undefined
|
||||
selectorFn?: (id: T) => void
|
||||
}) => {
|
||||
const navigate = useNavigate()
|
||||
const id = row.original[idFieldName]
|
||||
const id = row.original[idFieldName!]
|
||||
const getIconToShow = () => {
|
||||
if (selectorFn) return <AddCircleOutlineIcon />
|
||||
return <ManageSearchIcon />
|
||||
|
||||
@@ -107,7 +107,7 @@ export const TableView = <T extends MRT_RowData>({
|
||||
if (selectorFn) {
|
||||
return
|
||||
}
|
||||
setIdList(table.getPrePaginationRowModel().rows.map(row => row.original[idFieldName] as string))
|
||||
setIdList(table.getPrePaginationRowModel().rows.map(row => row.original[idFieldName!] as string))
|
||||
|
||||
// Don't put setIdList in the dependency array: it will cause re-render loop.
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
|
||||
Reference in New Issue
Block a user