From c792a8bf13f92da80829daab3322fb4c5ca3b70a Mon Sep 17 00:00:00 2001 From: nabenabe0928 Date: Thu, 21 Dec 2023 16:25:38 +0100 Subject: [PATCH] Refactor comments --- optuna_dashboard/ts/components/DataGrid.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/optuna_dashboard/ts/components/DataGrid.tsx b/optuna_dashboard/ts/components/DataGrid.tsx index b326b0b7..0ed6e679 100644 --- a/optuna_dashboard/ts/components/DataGrid.tsx +++ b/optuna_dashboard/ts/components/DataGrid.tsx @@ -49,7 +49,7 @@ function PaginationTextFieldComponent(props: { onInputChange: (value: number) => void maxPageNumber: number }): React.ReactElement { - // This component is separated from DataGrid to prevent it from updating, + // This component is separated from DataGrid to prevent `DataGrid` from re-rendering the page, // every time any letters are input. const { onInputChange, maxPageNumber } = props const [navigationPage, setNavigationPage] = React.useState("") @@ -62,7 +62,7 @@ function PaginationTextFieldComponent(props: { return } const newPageNumber = newPage <= 0 ? 1 : Math.min(newPage, maxPageNumber) - // 0-indexed. + // Page is 0-indexed in `TablePagination`. onInputChange(newPageNumber - 1) } @@ -215,6 +215,7 @@ function DataGrid(props: { {filteredRows.length > 0 ? ( + // tslint:disable-next-line: 2590