) {
apiRef = useGridApiRef();
return (
);
- };
+ }
describe('columnHeaderParams', () => {
it('should include the correct params', () => {
@@ -368,7 +368,7 @@ describe(' - Events Params', () => {
{ id: 5, brand: 'Reebok' },
];
const handleRowsScrollEnd = spy();
- const TestCase = ({ rows }: { rows: typeof baseRows }) => {
+ function TestCase({ rows }: { rows: typeof baseRows }) {
return (
- Events Params', () => {
/>
);
- };
+ }
const { container, setProps } = render( );
const virtualScroller = container.querySelector('.MuiDataGrid-virtualScroller');
// arbitrary number to make sure that the bottom of the grid window is reached.
diff --git a/packages/grid/x-data-grid-pro/src/tests/export.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/export.DataGridPro.test.tsx
index da3c39d25c0b6..5b817fa6924e4 100644
--- a/packages/grid/x-data-grid-pro/src/tests/export.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/export.DataGridPro.test.tsx
@@ -19,7 +19,7 @@ describe(' - Export', () => {
describe('getDataAsCsv', () => {
it('should work with basic strings', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -45,7 +45,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(
@@ -65,7 +65,7 @@ describe(' - Export', () => {
});
it('should work with comma', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -86,7 +86,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(
@@ -95,7 +95,7 @@ describe(' - Export', () => {
});
it('should apply valueFormatter correctly', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -123,7 +123,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(
@@ -132,7 +132,7 @@ describe(' - Export', () => {
});
it('should work with double quotes', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -153,7 +153,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(
@@ -162,7 +162,7 @@ describe(' - Export', () => {
});
it('should work with newline', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -191,7 +191,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(
@@ -206,7 +206,7 @@ describe(' - Export', () => {
});
it('should allow to change the delimiter', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -227,7 +227,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(
@@ -238,7 +238,7 @@ describe(' - Export', () => {
});
it('should only export the selected rows if any', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -260,14 +260,14 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(['id,Brand', '0,Nike'].join('\r\n'));
});
it('should export the rows returned by params.getRowsToExport if defined', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -288,7 +288,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv({ getRowsToExport: () => [0] })).to.equal(
@@ -297,7 +297,7 @@ describe(' - Export', () => {
});
it('should not export hidden column', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -319,14 +319,14 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(['id', '0', '1'].join('\r\n'));
});
it('should export hidden column if params.allColumns = true', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -348,7 +348,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(
@@ -359,7 +359,7 @@ describe(' - Export', () => {
});
it('should not export columns with column.disableExport = true', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -383,7 +383,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(
@@ -394,7 +394,7 @@ describe(' - Export', () => {
});
it('should only export columns in params.fields if defined', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -416,7 +416,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(
@@ -427,7 +427,7 @@ describe(' - Export', () => {
});
it('should export column defined in params.fields even if `columnVisibilityModel` does not include the field or column.disableExport=true', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -452,7 +452,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(
@@ -463,7 +463,7 @@ describe(' - Export', () => {
});
it('should work with booleans', () => {
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -479,7 +479,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(apiRef.current.getDataAsCsv()).to.equal(['id,isAdmin', '0,Yes', '1,No'].join('\r\n'));
});
@@ -490,7 +490,7 @@ describe(' - Export', () => {
{ value: 'BR', label: 'Brazil' },
];
- const TestCaseCSVExport = () => {
+ function TestCaseCSVExport() {
apiRef = useGridApiRef();
return (
@@ -512,7 +512,7 @@ describe(' - Export', () => {
/>
);
- };
+ }
render( );
expect(() => {
diff --git a/packages/grid/x-data-grid-pro/src/tests/filterPanel.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/filterPanel.DataGridPro.test.tsx
index 7102ef025d617..c2644fb3ab81c 100644
--- a/packages/grid/x-data-grid-pro/src/tests/filterPanel.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/filterPanel.DataGridPro.test.tsx
@@ -24,14 +24,14 @@ describe(' - Filter panel', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
apiRef = useGridApiRef();
return (
);
- };
+ }
it('should add an id and operatorValue to the filter item created when opening the filter panel', () => {
render( );
diff --git a/packages/grid/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx
index e200a81b198a5..ad8e59b25a03f 100644
--- a/packages/grid/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/filtering.DataGridPro.test.tsx
@@ -46,7 +46,7 @@ describe(' - Filter', () => {
columns: [{ field: 'brand' }],
};
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
const { rows, ...other } = props;
apiRef = useGridApiRef();
return (
@@ -60,7 +60,7 @@ describe(' - Filter', () => {
/>
);
- };
+ }
const filterModel = {
items: [
@@ -741,7 +741,7 @@ describe(' - Filter', () => {
});
it('should control filter state when the model and the onChange are set', () => {
- const ControlCase = (props: Partial) => {
+ function ControlCase(props: Partial) {
const { rows, columns, ...others } = props;
const [caseFilterModel, setFilterModel] = React.useState(getDefaultGridFilterModel);
const handleFilterChange: DataGridProProps['onFilterModelChange'] = (newModel) => {
@@ -766,7 +766,7 @@ describe(' - Filter', () => {
/>
);
- };
+ }
render( );
const addButton = screen.getByRole('button', { name: /Add Filter/i });
diff --git a/packages/grid/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx
index 3cc697c4b4dae..d65010068028c 100644
--- a/packages/grid/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/layout.DataGridPro.test.tsx
@@ -85,7 +85,7 @@ describe(' - Layout', () => {
it('should resize flex: 1 column when changing column visibility to avoid exceeding grid width (apiRef setColumnVisibility method call)', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Omit) => {
+ function TestCase(props: Omit) {
apiRef = useGridApiRef();
return (
@@ -93,7 +93,7 @@ describe(' - Layout', () => {
);
- };
+ }
render(
- Lazy loader', () => {
let apiRef: React.MutableRefObject;
- const TestLazyLoader = (props: Partial) => {
+ function TestLazyLoader(props: Partial) {
apiRef = useGridApiRef();
return (
@@ -58,7 +58,7 @@ describe(' - Lazy loader', () => {
/>
);
- };
+ }
it('should not call onFetchRows if the viewport is fully loaded', function test() {
if (isJSDOM) {
diff --git a/packages/grid/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx
index 177c1182de96d..6012d693201bd 100644
--- a/packages/grid/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/pagination.DataGridPro.test.tsx
@@ -13,7 +13,7 @@ describe(' - Pagination', () => {
it('should apply valid value', () => {
let apiRef: React.MutableRefObject;
- const GridTest = () => {
+ function GridTest() {
const basicData = useBasicDemoData(20, 2);
apiRef = useGridApiRef();
@@ -28,7 +28,7 @@ describe(' - Pagination', () => {
/>
);
- };
+ }
render( );
@@ -42,7 +42,7 @@ describe(' - Pagination', () => {
it('should apply last page if trying to go to a non-existing page', () => {
let apiRef: React.MutableRefObject;
- const GridTest = () => {
+ function GridTest() {
const basicData = useBasicDemoData(20, 2);
apiRef = useGridApiRef();
@@ -57,7 +57,7 @@ describe(' - Pagination', () => {
/>
);
- };
+ }
render( );
@@ -73,7 +73,7 @@ describe(' - Pagination', () => {
describe('setPageSize', () => {
it('should apply value', () => {
let apiRef: React.MutableRefObject;
- const GridTest = () => {
+ function GridTest() {
const [pageSize, setPageSize] = React.useState(5);
const basicData = useBasicDemoData(20, 2);
apiRef = useGridApiRef();
@@ -91,7 +91,7 @@ describe(' - Pagination', () => {
/>
);
- };
+ }
render( );
clock.runToLast();
diff --git a/packages/grid/x-data-grid-pro/src/tests/printExport.DataGrid.test.tsx b/packages/grid/x-data-grid-pro/src/tests/printExport.DataGrid.test.tsx
index 46e832de4b3af..1840c3796354c 100644
--- a/packages/grid/x-data-grid-pro/src/tests/printExport.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/printExport.DataGrid.test.tsx
@@ -25,7 +25,7 @@ describe(' - Print export', () => {
rowsPerPageOptions: [NB_ROWS, 100],
};
- const Test = (props: Partial) => {
+ function Test(props: Partial) {
apiRef = useGridApiRef();
return (
@@ -33,7 +33,7 @@ describe(' - Print export', () => {
);
- };
+ }
const allBooleanConfigurations = [
{
diff --git a/packages/grid/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx
index 483b073c20f8a..e6d2e41f4412d 100644
--- a/packages/grid/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/rowEditing.DataGridPro.test.tsx
@@ -23,7 +23,7 @@ describe(' - Row Editing', () => {
const defaultData = getBasicGridData(4, 4);
- const CustomEditComponent = ({ hasFocus }: GridRenderEditCellParams) => {
+ function CustomEditComponent({ hasFocus }: GridRenderEditCellParams) {
const ref = React.useRef(null);
React.useLayoutEffect(() => {
if (hasFocus) {
@@ -31,7 +31,7 @@ describe(' - Row Editing', () => {
}
}, [hasFocus]);
return ;
- };
+ }
const renderEditCell1 = spy((props: GridRenderEditCellParams) => (
@@ -44,7 +44,7 @@ describe(' - Row Editing', () => {
let column1Props: any = {};
let column2Props: any = {};
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
apiRef = useGridApiRef();
return (
@@ -76,7 +76,7 @@ describe(' - Row Editing', () => {
/>
);
- };
+ }
afterEach(() => {
renderEditCell1.resetHistory();
diff --git a/packages/grid/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx
index 6aa417b995922..48f4f97972ca8 100644
--- a/packages/grid/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/rowPinning.DataGridPro.test.tsx
@@ -52,7 +52,7 @@ describe(' - Row pinning', () => {
return container.contains(row);
}
- const BaselineTestCase = ({
+ function BaselineTestCase({
rowCount,
colCount,
height = 300,
@@ -61,7 +61,7 @@ describe(' - Row pinning', () => {
rowCount: number;
colCount: number;
height?: number | string;
- } & Partial) => {
+ } & Partial) {
const data = getBasicGridData(rowCount, colCount);
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;
@@ -79,7 +79,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
it('should render pinned rows in pinned containers', () => {
render( );
@@ -91,7 +91,7 @@ describe(' - Row pinning', () => {
it('should treat row as pinned even if row with the same id is present in `rows` prop', () => {
const rowCount = 5;
- const TestCase = ({ pinRows = true }) => {
+ function TestCase({ pinRows = true }) {
const data = getBasicGridData(rowCount, 5);
const pinnedRows = React.useMemo(() => {
@@ -114,7 +114,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
const { setProps } = render( );
@@ -162,7 +162,7 @@ describe(' - Row pinning', () => {
it('should update pinned rows when `pinnedRows` prop change', () => {
const data = getBasicGridData(20, 5);
- const TestCase = (props: any) => {
+ function TestCase(props: any) {
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;
return (
@@ -178,7 +178,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
const { setProps } = render( );
@@ -201,7 +201,7 @@ describe(' - Row pinning', () => {
const data = getBasicGridData(20, 5);
let apiRef!: React.MutableRefObject;
- const TestCase = (props: any) => {
+ function TestCase(props: any) {
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;
apiRef = useGridApiRef();
return (
@@ -219,7 +219,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
render( );
@@ -258,7 +258,7 @@ describe(' - Row pinning', () => {
});
it('should work with `getRowId`', () => {
- const TestCase = () => {
+ function TestCase() {
const data = getBasicGridData(20, 5);
const rowsData = data.rows.map((row) => {
@@ -290,7 +290,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
render( );
@@ -361,7 +361,7 @@ describe(' - Row pinning', () => {
}
it('should work with top pinned rows', () => {
- const TestCase = () => {
+ function TestCase() {
const data = getBasicGridData(20, 5);
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;
@@ -377,7 +377,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
render( );
@@ -404,7 +404,7 @@ describe(' - Row pinning', () => {
});
it('should work with bottom pinned rows', () => {
- const TestCase = () => {
+ function TestCase() {
const data = getBasicGridData(5, 5);
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;
@@ -420,7 +420,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
render( );
@@ -449,7 +449,7 @@ describe(' - Row pinning', () => {
this.skip();
}
- const TestCase = () => {
+ function TestCase() {
const data = getBasicGridData(5, 7);
const [pinnedRow0, pinnedRow1, ...rows] = data.rows;
@@ -472,7 +472,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
render( );
@@ -694,7 +694,7 @@ describe(' - Row pinning', () => {
const columns = [{ field: 'name', width: 200 }];
- const Test = () => {
+ function Test() {
const [pinnedRow0, pinnedRow1, ...rowsData] = rows;
return (
@@ -712,7 +712,7 @@ describe(' - Row pinning', () => {
/>
);
- };
+ }
render( );
@@ -723,10 +723,10 @@ describe(' - Row pinning', () => {
it('should not be selectable', () => {
let apiRef: React.MutableRefObject;
- const TestCase = () => {
+ function TestCase() {
apiRef = useGridApiRef();
return ;
- };
+ }
render( );
@@ -744,10 +744,10 @@ describe(' - Row pinning', () => {
it('should export pinned rows to CSV', () => {
let apiRef: React.MutableRefObject;
- const TestCase = () => {
+ function TestCase() {
apiRef = useGridApiRef();
return ;
- };
+ }
render( );
diff --git a/packages/grid/x-data-grid-pro/src/tests/rowReorder.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/rowReorder.DataGridPro.test.tsx
index c7e7d6dfe6d5d..757b0b06b80d7 100644
--- a/packages/grid/x-data-grid-pro/src/tests/rowReorder.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/rowReorder.DataGridPro.test.tsx
@@ -38,7 +38,7 @@ describe(' - Row reorder', () => {
];
const columns = [{ field: 'brand' }];
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
return (
@@ -46,7 +46,7 @@ describe(' - Row reorder', () => {
);
- };
+ }
render( );
@@ -74,7 +74,7 @@ describe(' - Row reorder', () => {
];
const columns = [{ field: 'brand' }];
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
return (
@@ -82,7 +82,7 @@ describe(' - Row reorder', () => {
);
- };
+ }
render( );
expect(getRowsFieldContent('brand')).to.deep.equal(['Nike', 'Adidas', 'Puma']);
@@ -102,7 +102,7 @@ describe(' - Row reorder', () => {
];
const columns = [{ field: 'brand' }];
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
return (
@@ -110,7 +110,7 @@ describe(' - Row reorder', () => {
);
- };
+ }
render( );
expect(getRowsFieldContent('brand')).to.deep.equal(['Nike', 'Adidas', 'Puma']);
@@ -123,7 +123,7 @@ describe(' - Row reorder', () => {
it('should call onRowOrderChange after the row stops being dragged', () => {
const handleOnRowOrderChange = spy();
let apiRef: React.MutableRefObject;
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
const rows = [
{ id: 0, brand: 'Nike' },
@@ -143,7 +143,7 @@ describe(' - Row reorder', () => {
/>
);
- };
+ }
render( );
@@ -169,7 +169,7 @@ describe(' - Row reorder', () => {
const handleDragOver = spy();
const handleDragEnd = spy();
let apiRef: React.MutableRefObject;
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
const data = useBasicDemoData(3, 3);
@@ -185,7 +185,7 @@ describe(' - Row reorder', () => {
);
- };
+ }
render( );
diff --git a/packages/grid/x-data-grid-pro/src/tests/rowSelection.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/rowSelection.DataGridPro.test.tsx
index 688523b241412..1087d71bf541d 100644
--- a/packages/grid/x-data-grid-pro/src/tests/rowSelection.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/rowSelection.DataGridPro.test.tsx
@@ -29,11 +29,11 @@ describe(' - Row Selection', () => {
let apiRef: React.MutableRefObject;
- const TestDataGridSelection = ({
+ function TestDataGridSelection({
rowLength = 4,
...other
}: Omit &
- Partial> & { rowLength?: number }) => {
+ Partial> & { rowLength?: number }) {
apiRef = useGridApiRef();
const data = React.useMemo(() => getBasicGridData(rowLength, 2), [rowLength]);
@@ -43,7 +43,7 @@ describe(' - Row Selection', () => {
);
- };
+ }
describe('prop: checkboxSelectionVisibleOnly = false', () => {
it('should select all rows of all pages if no row is selected', () => {
diff --git a/packages/grid/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
index 26c59f57acb60..7a536a6c69f20 100644
--- a/packages/grid/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/rows.DataGridPro.test.tsx
@@ -70,14 +70,14 @@ describe(' - Rows', () => {
editableProps.columns = editableProps.columns.map((col) => ({ ...col, editable: true }));
const getRowId: DataGridProProps['getRowId'] = (row) => `${row.clientId}`;
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
return (
);
- };
+ }
render( );
act(() => apiRef!.current.startCellEditMode({ id: 'c2', field: 'first' }));
const cell = getCell(1, 1);
@@ -95,14 +95,14 @@ describe(' - Rows', () => {
it('should not clone the row', () => {
const getRowId: DataGridProProps['getRowId'] = (row) => `${row.clientId}`;
let apiRef: React.MutableRefObject;
- const Test = () => {
+ function Test() {
apiRef = useGridApiRef();
return (
);
- };
+ }
render( );
expect(apiRef!.current.getRow('c1')).to.equal(baselineProps.rows[0]);
});
@@ -112,17 +112,19 @@ describe(' - Rows', () => {
it('should not throttle even when props.throttleRowsMs is defined', () => {
const { rows, columns } = getBasicGridData(5, 2);
- const Test = (props: Pick) => (
-
-
-
- );
+ function Test(props: Pick) {
+ return (
+
+
+
+ );
+ }
const { setProps } = render( );
@@ -156,14 +158,14 @@ describe(' - Rows', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
apiRef = useGridApiRef();
return (
);
- };
+ }
it('should not throttle by default', () => {
render( );
@@ -235,7 +237,7 @@ describe(' - Rows', () => {
});
it('update row data should process getRowId', () => {
- const TestCaseGetRowId = () => {
+ function TestCaseGetRowId() {
apiRef = useGridApiRef();
const getRowId = React.useCallback((row: GridRowModel) => row.idField, []);
return (
@@ -248,7 +250,7 @@ describe(' - Rows', () => {
/>
);
- };
+ }
render( );
expect(getColumnValues(0)).to.deep.equal(['Nike', 'Adidas', 'Puma']);
@@ -264,14 +266,14 @@ describe(' - Rows', () => {
});
it('should not loose partial updates after a props.loading switch', () => {
- const Test = (props: Partial) => {
+ function Test(props: Partial) {
apiRef = useGridApiRef();
return (
);
- };
+ }
const { setProps } = render( );
expect(getColumnValues(0)).to.deep.equal(['Nike', 'Adidas', 'Puma']);
@@ -307,14 +309,14 @@ describe(' - Rows', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
apiRef = useGridApiRef();
return (
);
- };
+ }
it('should not throttle by default', () => {
render( );
@@ -369,14 +371,14 @@ describe(' - Rows', () => {
});
let apiRef: React.MutableRefObject;
- const TestCaseVirtualization = (
+ function TestCaseVirtualization(
props: Partial & {
nbRows?: number;
nbCols?: number;
width?: number;
height?: number;
},
- ) => {
+ ) {
apiRef = useGridApiRef();
const data = useBasicDemoData(props.nbRows || 100, props.nbCols || 10);
@@ -385,7 +387,7 @@ describe(' - Rows', () => {
);
- };
+ }
it('should render last row when scrolling to the bottom', () => {
const rowHeight = 50;
@@ -640,7 +642,7 @@ describe(' - Rows', () => {
describe('no virtualization', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial & { nbRows?: number; nbCols?: number }) => {
+ function TestCase(props: Partial & { nbRows?: number; nbCols?: number }) {
apiRef = useGridApiRef();
const data = useBasicDemoData(props.nbRows || 10, props.nbCols || 10);
return (
@@ -654,7 +656,7 @@ describe(' - Rows', () => {
/>
);
- };
+ }
it('should allow to disable virtualization', () => {
render( );
@@ -673,7 +675,7 @@ describe(' - Rows', () => {
describe('Cell focus', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
apiRef = useGridApiRef();
return (
@@ -681,7 +683,7 @@ describe(' - Rows', () => {
);
- };
+ }
beforeEach(() => {
baselineProps = {
@@ -863,14 +865,14 @@ describe(' - Rows', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
apiRef = useGridApiRef();
return (
);
- };
+ }
it('should change row height', () => {
const resizedRowId = 1;
@@ -903,13 +905,13 @@ describe(' - Rows', () => {
});
describe('prop: rowCount', () => {
- const TestCase = (props: DataGridProProps) => {
+ function TestCase(props: DataGridProProps) {
return (
);
- };
+ }
it('should not show total row count in footer if `rowCount === rows.length`', () => {
const { rows, columns } = getBasicGridData(10, 2);
diff --git a/packages/grid/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx
index 06efe9145a602..7d2a3c8c9dcaf 100644
--- a/packages/grid/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/sorting.DataGridPro.test.tsx
@@ -42,7 +42,7 @@ describe(' - Sorting', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
const { rows, ...other } = props;
apiRef = useGridApiRef();
return (
@@ -55,7 +55,7 @@ describe(' - Sorting', () => {
/>
);
- };
+ }
const renderBrandSortedAsc = () => {
const sortModel: GridSortModel = [{ field: 'brand', sort: 'asc' }];
@@ -240,7 +240,7 @@ describe(' - Sorting', () => {
it('should control sort state when the model and the onChange are set', () => {
let expectedModel: GridSortModel = [];
- const ControlCase = (props: Partial) => {
+ function ControlCase(props: Partial) {
const { rows, columns, ...others } = props;
const [caseSortModel, setSortModel] = React.useState([]);
const handleSortChange: DataGridProProps['onSortModelChange'] = (newModel) => {
@@ -260,7 +260,7 @@ describe(' - Sorting', () => {
/>
);
- };
+ }
render( );
fireEvent.click(getColumnHeaderCell(0));
@@ -271,17 +271,19 @@ describe(' - Sorting', () => {
it('should not call onSortModelChange on initialization or on sortModel prop change', () => {
const onSortModelChange = spy();
- const Test = (props: Partial) => (
-
-
-
- );
+ function Test(props: Partial) {
+ return (
+
+
+
+ );
+ }
const { setProps } = render(
- State Persistence', () => {
let apiRef: React.MutableRefObject;
- const TestCase = (props: Omit) => {
+ function TestCase(props: Omit) {
apiRef = useGridApiRef();
return (
@@ -110,7 +110,7 @@ describe(' - State Persistence', () => {
/>
);
- };
+ }
describe('apiRef: exportState', () => {
it('should export the default values of the models', () => {
@@ -258,7 +258,7 @@ describe(' - State Persistence', () => {
});
it('should restore controlled sub-state', () => {
- const ControlledTest = () => {
+ function ControlledTest() {
const [page, setPage] = React.useState(0);
return (
@@ -269,7 +269,7 @@ describe(' - State Persistence', () => {
}}
/>
);
- };
+ }
render( );
act(() =>
diff --git a/packages/grid/x-data-grid-pro/src/tests/treeData.DataGridPro.test.tsx b/packages/grid/x-data-grid-pro/src/tests/treeData.DataGridPro.test.tsx
index 2fa5bbf93f995..95a4f8a80b05b 100644
--- a/packages/grid/x-data-grid-pro/src/tests/treeData.DataGridPro.test.tsx
+++ b/packages/grid/x-data-grid-pro/src/tests/treeData.DataGridPro.test.tsx
@@ -61,7 +61,7 @@ describe(' - Tree Data', () => {
let apiRef: React.MutableRefObject;
- const Test = (props: Partial) => {
+ function Test(props: Partial) {
apiRef = useGridApiRef();
return (
@@ -69,7 +69,7 @@ describe(' - Tree Data', () => {
);
- };
+ }
describe('prop: treeData', () => {
it('should support tree data toggling', () => {
diff --git a/packages/grid/x-data-grid/src/components/GridRow.tsx b/packages/grid/x-data-grid/src/components/GridRow.tsx
index d97d27be6e766..5539664bd80d4 100644
--- a/packages/grid/x-data-grid/src/components/GridRow.tsx
+++ b/packages/grid/x-data-grid/src/components/GridRow.tsx
@@ -84,7 +84,7 @@ const useUtilityClasses = (ownerState: OwnerState) => {
return composeClasses(slots, getDataGridUtilityClass, classes);
};
-const EmptyCell = ({ width }: { width: number }) => {
+function EmptyCell({ width }: { width: number }) {
if (!width) {
return null;
}
@@ -92,7 +92,7 @@ const EmptyCell = ({ width }: { width: number }) => {
const style = { width };
return
; // TODO change to .MuiDataGrid-emptyCell or .MuiDataGrid-rowFiller
-};
+}
const GridRow = React.forwardRef<
HTMLDivElement,
diff --git a/packages/grid/x-data-grid/src/components/cell/GridActionsCell.tsx b/packages/grid/x-data-grid/src/components/cell/GridActionsCell.tsx
index 879440ff65036..eb222ce7153e3 100644
--- a/packages/grid/x-data-grid/src/components/cell/GridActionsCell.tsx
+++ b/packages/grid/x-data-grid/src/components/cell/GridActionsCell.tsx
@@ -23,7 +23,7 @@ interface GridActionsCellProps extends Omit {
+function GridActionsCell(props: GridActionsCellProps) {
const {
colDef,
id,
@@ -227,7 +227,7 @@ const GridActionsCell = (props: GridActionsCellProps) => {
)}
);
-};
+}
GridActionsCell.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/cell/GridBooleanCell.tsx b/packages/grid/x-data-grid/src/components/cell/GridBooleanCell.tsx
index ca63510dbed88..af422085b3d5b 100644
--- a/packages/grid/x-data-grid/src/components/cell/GridBooleanCell.tsx
+++ b/packages/grid/x-data-grid/src/components/cell/GridBooleanCell.tsx
@@ -26,7 +26,7 @@ interface GridBooleanCellProps
extends GridRenderCellParams,
Omit {}
-const GridBooleanCellRaw = (props: GridBooleanCellProps) => {
+function GridBooleanCellRaw(props: GridBooleanCellProps) {
const {
id,
value,
@@ -66,7 +66,7 @@ const GridBooleanCellRaw = (props: GridBooleanCellProps) => {
{...other}
/>
);
-};
+}
GridBooleanCellRaw.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/menu/GridMenu.tsx b/packages/grid/x-data-grid/src/components/menu/GridMenu.tsx
index ed77c2c302a8a..e9f6e705d2f2d 100644
--- a/packages/grid/x-data-grid/src/components/menu/GridMenu.tsx
+++ b/packages/grid/x-data-grid/src/components/menu/GridMenu.tsx
@@ -64,7 +64,7 @@ const transformOrigin = {
'bottom-end': 'top right',
};
-const GridMenu = (props: GridMenuProps) => {
+function GridMenu(props: GridMenuProps) {
const { open, target, onClickAway, children, position, className, onExited, ...other } = props;
const apiRef = useGridApiContext();
const prevTarget = React.useRef(target);
@@ -120,7 +120,7 @@ const GridMenu = (props: GridMenuProps) => {
)}
);
-};
+}
GridMenu.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/menu/columnMenu/GridColumnsMenuItem.tsx b/packages/grid/x-data-grid/src/components/menu/columnMenu/GridColumnsMenuItem.tsx
index 0bb633429fa04..dcb0dd6ba7a9e 100644
--- a/packages/grid/x-data-grid/src/components/menu/columnMenu/GridColumnsMenuItem.tsx
+++ b/packages/grid/x-data-grid/src/components/menu/columnMenu/GridColumnsMenuItem.tsx
@@ -6,7 +6,7 @@ import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
import { GridFilterItemProps } from './GridFilterItemProps';
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
-const GridColumnsMenuItem = (props: GridFilterItemProps) => {
+function GridColumnsMenuItem(props: GridFilterItemProps) {
const { onClick } = props;
const apiRef = useGridApiContext();
const rootProps = useGridRootProps();
@@ -28,7 +28,7 @@ const GridColumnsMenuItem = (props: GridFilterItemProps) => {
{apiRef.current.getLocaleText('columnMenuShowColumns')}
);
-};
+}
GridColumnsMenuItem.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/menu/columnMenu/GridFilterMenuItem.tsx b/packages/grid/x-data-grid/src/components/menu/columnMenu/GridFilterMenuItem.tsx
index 3b2f61d300e58..785e17fc19580 100644
--- a/packages/grid/x-data-grid/src/components/menu/columnMenu/GridFilterMenuItem.tsx
+++ b/packages/grid/x-data-grid/src/components/menu/columnMenu/GridFilterMenuItem.tsx
@@ -5,7 +5,7 @@ import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
import { GridFilterItemProps } from './GridFilterItemProps';
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
-const GridFilterMenuItem = (props: GridFilterItemProps) => {
+function GridFilterMenuItem(props: GridFilterItemProps) {
const { column, onClick } = props;
const apiRef = useGridApiContext();
const rootProps = useGridRootProps();
@@ -25,7 +25,7 @@ const GridFilterMenuItem = (props: GridFilterItemProps) => {
return (
{apiRef.current.getLocaleText('columnMenuFilter')}
);
-};
+}
GridFilterMenuItem.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/menu/columnMenu/HideGridColMenuItem.tsx b/packages/grid/x-data-grid/src/components/menu/columnMenu/HideGridColMenuItem.tsx
index 6c4cae71bebf6..fcde932ad24a8 100644
--- a/packages/grid/x-data-grid/src/components/menu/columnMenu/HideGridColMenuItem.tsx
+++ b/packages/grid/x-data-grid/src/components/menu/columnMenu/HideGridColMenuItem.tsx
@@ -6,7 +6,7 @@ import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
import { useGridRootProps } from '../../../hooks/utils/useGridRootProps';
import { gridVisibleColumnDefinitionsSelector } from '../../../hooks/features/columns';
-const HideGridColMenuItem = (props: GridFilterItemProps) => {
+function HideGridColMenuItem(props: GridFilterItemProps) {
const { column, onClick } = props;
const apiRef = useGridApiContext();
const rootProps = useGridRootProps();
@@ -53,7 +53,7 @@ const HideGridColMenuItem = (props: GridFilterItemProps) => {
{apiRef.current.getLocaleText('columnMenuHideColumn')}
);
-};
+}
HideGridColMenuItem.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/menu/columnMenu/SortGridMenuItems.tsx b/packages/grid/x-data-grid/src/components/menu/columnMenu/SortGridMenuItems.tsx
index 29d6f366f1b5e..ac345d2fe1128 100644
--- a/packages/grid/x-data-grid/src/components/menu/columnMenu/SortGridMenuItems.tsx
+++ b/packages/grid/x-data-grid/src/components/menu/columnMenu/SortGridMenuItems.tsx
@@ -7,7 +7,7 @@ import { GridSortDirection } from '../../../models/gridSortModel';
import { useGridApiContext } from '../../../hooks/utils/useGridApiContext';
import { GridFilterItemProps } from './GridFilterItemProps';
-const SortGridMenuItems = (props: GridFilterItemProps) => {
+function SortGridMenuItems(props: GridFilterItemProps) {
const { column, onClick } = props;
const apiRef = useGridApiContext();
const sortModel = useGridSelector(apiRef, gridSortModelSelector);
@@ -46,7 +46,7 @@ const SortGridMenuItems = (props: GridFilterItemProps) => {
);
-};
+}
SortGridMenuItems.propTypes = {
// ----------------------------- Warning --------------------------------
diff --git a/packages/grid/x-data-grid/src/components/toolbar/GridToolbarExport.tsx b/packages/grid/x-data-grid/src/components/toolbar/GridToolbarExport.tsx
index d3f7e69a31be8..ab8b2bf22366f 100644
--- a/packages/grid/x-data-grid/src/components/toolbar/GridToolbarExport.tsx
+++ b/packages/grid/x-data-grid/src/components/toolbar/GridToolbarExport.tsx
@@ -29,7 +29,7 @@ export interface GridToolbarExportProps extends ButtonProps {
[key: string]: any;
}
-export const GridCsvExportMenuItem = (props: GridCsvExportMenuItemProps) => {
+export function GridCsvExportMenuItem(props: GridCsvExportMenuItemProps) {
const apiRef = useGridApiContext();
const { hideMenu, options, ...other } = props;
@@ -44,9 +44,9 @@ export const GridCsvExportMenuItem = (props: GridCsvExportMenuItemProps) => {
{apiRef.current.getLocaleText('toolbarExportCSV')}
);
-};
+}
-export const GridPrintExportMenuItem = (props: GridPrintExportMenuItemProps) => {
+export function GridPrintExportMenuItem(props: GridPrintExportMenuItemProps) {
const apiRef = useGridApiContext();
const { hideMenu, options, ...other } = props;
@@ -61,7 +61,7 @@ export const GridPrintExportMenuItem = (props: GridPrintExportMenuItemProps) =>
{apiRef.current.getLocaleText('toolbarExportPrint')}
);
-};
+}
const GridToolbarExport = React.forwardRef(
function GridToolbarExport(props, ref) {
diff --git a/packages/grid/x-data-grid/src/context/GridContextProvider.tsx b/packages/grid/x-data-grid/src/context/GridContextProvider.tsx
index b530cd9f73595..2fd8de2a3e435 100644
--- a/packages/grid/x-data-grid/src/context/GridContextProvider.tsx
+++ b/packages/grid/x-data-grid/src/context/GridContextProvider.tsx
@@ -10,11 +10,7 @@ type GridContextProviderProps = {
children: React.ReactNode;
};
-export const GridContextProvider = ({
- privateApiRef,
- props,
- children,
-}: GridContextProviderProps) => {
+export function GridContextProvider({ privateApiRef, props, children }: GridContextProviderProps) {
const apiRef = React.useRef(privateApiRef.current.getPublicApi());
return (
@@ -24,4 +20,4 @@ export const GridContextProvider = ({
);
-};
+}
diff --git a/packages/grid/x-data-grid/src/hooks/features/rowSelection/useGridRowSelection.ts b/packages/grid/x-data-grid/src/hooks/features/rowSelection/useGridRowSelection.ts
index bfd6bdc382e01..d11a47d46f932 100644
--- a/packages/grid/x-data-grid/src/hooks/features/rowSelection/useGridRowSelection.ts
+++ b/packages/grid/x-data-grid/src/hooks/features/rowSelection/useGridRowSelection.ts
@@ -262,7 +262,7 @@ export const useGridRowSelection = (
endId: GridRowId;
},
isSelected = true,
- resetSelection,
+ resetSelection = false,
) => {
if (!apiRef.current.getRow(startId) || !apiRef.current.getRow(endId)) {
return;
diff --git a/packages/grid/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx b/packages/grid/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx
index 6a4ddc1d6789c..1bee67891e959 100644
--- a/packages/grid/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx
+++ b/packages/grid/x-data-grid/src/hooks/utils/useGridApiEventHandler.test.tsx
@@ -37,10 +37,10 @@ describe('useGridApiEventHandler', () => {
current: { subscribeEvent: spy(() => unsubscribe) },
};
- const Test = () => {
+ function Test() {
useGridApiEventHandler(apiRef as any, 'cellClick', noop);
return null;
- };
+ }
const { unmount } = render( );
@@ -69,10 +69,10 @@ describe('useGridApiEventHandler', () => {
current: { subscribeEvent: spy(() => unsubscribe) },
};
- const Test = () => {
+ function Test() {
useGridApiEventHandler(apiRef as any, 'cellClick', noop);
return null;
- };
+ }
const { unmount } = render( );
diff --git a/packages/grid/x-data-grid/src/tests/columns.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/columns.DataGrid.test.tsx
index 7d52b2727ac5a..c0ac823893bab 100644
--- a/packages/grid/x-data-grid/src/tests/columns.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/columns.DataGrid.test.tsx
@@ -17,14 +17,16 @@ const columns: GridColumns = [{ field: 'id' }, { field: 'idBis' }];
describe(' - Columns', () => {
const { render } = createRenderer();
- const TestDataGrid = (
+ function TestDataGrid(
props: Omit &
Partial>,
- ) => (
-
-
-
- );
+ ) {
+ return (
+
+
+
+ );
+ }
describe('prop: initialState.columns.orderedFields / initialState.columns.dimensions', () => {
it('should allow to initialize the columns order and dimensions', () => {
diff --git a/packages/grid/x-data-grid/src/tests/columns.spec.tsx b/packages/grid/x-data-grid/src/tests/columns.spec.tsx
index ffc89836b7ad6..189dea54ad236 100644
--- a/packages/grid/x-data-grid/src/tests/columns.spec.tsx
+++ b/packages/grid/x-data-grid/src/tests/columns.spec.tsx
@@ -3,7 +3,7 @@ import { DataGrid, GridRenderCellParams } from '@mui/x-data-grid';
import { GridCellParams } from '../models/params/gridCellParams';
import { GridActionsColDef, GridColDef, GridColumns, GridRowParams } from '../models';
-const RenderCellParamsExplicitTyping = () => {
+function RenderCellParamsExplicitTyping() {
return (
{
]}
/>
);
-};
+}
-const CellParamsFromRowModel = () => {
+function CellParamsFromRowModel() {
type PriceRowModel = { price1: number; price2: string };
const actionColumn: GridActionsColDef = {
@@ -101,9 +101,9 @@ const CellParamsFromRowModel = () => {
];
return ;
-};
+}
-const CellParamsValue = () => {
+function CellParamsValue() {
return (
{
}}
/>
);
-};
+}
-const CellParamsRow = () => {
+function CellParamsRow() {
return (
{
}}
/>
);
-};
+}
-const CellParamsFormattedValue = () => {
+function CellParamsFormattedValue() {
return (
{
}}
/>
);
-};
+}
diff --git a/packages/grid/x-data-grid/src/tests/columnsGrouping.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/columnsGrouping.DataGrid.test.tsx
index cfbb9217ea7e5..7928c3d355cb4 100644
--- a/packages/grid/x-data-grid/src/tests/columnsGrouping.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/columnsGrouping.DataGrid.test.tsx
@@ -30,14 +30,14 @@ type TestDataGridProps = Omit &
describe(' - Column grouping', () => {
const { render } = createRenderer();
- const TestDataGrid = (props: TestDataGridProps) => {
+ function TestDataGrid(props: TestDataGridProps) {
const { nbColumns, ...other } = props;
return (
);
- };
+ }
describe('Header grouping columns', () => {
it('should add one header row when columns have a group', () => {
@@ -291,11 +291,13 @@ describe(' - Column grouping', () => {
// TODO: remove the skip. I failed to test if an error is thrown
// eslint-disable-next-line mocha/no-skipped-tests
describe.skip('error messages', () => {
- const TestWithError = (props: TestDataGridProps) => (
-
-
-
- );
+ function TestWithError(props: TestDataGridProps) {
+ return (
+
+
+
+ );
+ }
it('should log an error if two groups have the same id', () => {
expect(() => {
diff --git a/packages/grid/x-data-grid/src/tests/columnsVisibility.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/columnsVisibility.DataGrid.test.tsx
index d67d0901fe068..b42be479be8d1 100644
--- a/packages/grid/x-data-grid/src/tests/columnsVisibility.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/columnsVisibility.DataGrid.test.tsx
@@ -15,14 +15,16 @@ const columns: GridColumns = [{ field: 'id' }, { field: 'idBis' }];
describe(' - Columns Visibility', () => {
const { render } = createRenderer();
- const TestDataGrid = (
+ function TestDataGrid(
props: Omit &
Partial>,
- ) => (
-
-
-
- );
+ ) {
+ return (
+
+
+
+ );
+ }
describe('prop: columnVisibilityModel and onColumnVisibilityModelChange', () => {
it('should allow to set the columnVisibilityModel prop', () => {
diff --git a/packages/grid/x-data-grid/src/tests/components.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/components.DataGrid.test.tsx
index a53915210b237..dc2fe292ec403 100644
--- a/packages/grid/x-data-grid/src/tests/components.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/components.DataGrid.test.tsx
@@ -43,7 +43,9 @@ describe(' - Components', () => {
});
it('should hide custom footer if prop hideFooter is set', () => {
- const CustomFooter = () => Custom Footer
;
+ function CustomFooter() {
+ return Custom Footer
;
+ }
render(
diff --git a/packages/grid/x-data-grid/src/tests/export.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/export.DataGrid.test.tsx
index b932235a0f8d4..37d361fdc6bb9 100644
--- a/packages/grid/x-data-grid/src/tests/export.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/export.DataGrid.test.tsx
@@ -9,7 +9,7 @@ import { createRenderer, screen, fireEvent } from '@mui/monorepo/test/utils';
describe(' - Export', () => {
const { render, clock } = createRenderer({ clock: 'fake' });
- const TestCase = (props: Omit) => {
+ function TestCase(props: Omit) {
const basicData = useBasicDemoData(3, 2);
return (
@@ -17,7 +17,7 @@ describe(' - Export', () => {
);
- };
+ }
// We need `createObjectURL` to test the downloaded value
before(function beforeHook() {
diff --git a/packages/grid/x-data-grid/src/tests/filterPanel.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/filterPanel.DataGrid.test.tsx
index 96e92d88031a0..f978405fba8c4 100644
--- a/packages/grid/x-data-grid/src/tests/filterPanel.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/filterPanel.DataGrid.test.tsx
@@ -129,13 +129,13 @@ describe(' - Filter panel', () => {
],
};
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
return (
);
- };
+ }
it('should show an empty string as the default filter input value', () => {
render(
diff --git a/packages/grid/x-data-grid/src/tests/filtering.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/filtering.DataGrid.test.tsx
index 18e154b03a394..9d185967d737d 100644
--- a/packages/grid/x-data-grid/src/tests/filtering.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/filtering.DataGrid.test.tsx
@@ -37,13 +37,13 @@ describe(' - Filter', () => {
columns: [{ field: 'brand' }],
};
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
return (
);
- };
+ }
describe('prop: filterModel', () => {
it('should throw for more than one filter item', () => {
diff --git a/packages/grid/x-data-grid/src/tests/keyboard.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/keyboard.DataGrid.test.tsx
index 92409bedcb314..ba9dc6d5306db 100644
--- a/packages/grid/x-data-grid/src/tests/keyboard.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/keyboard.DataGrid.test.tsx
@@ -35,12 +35,12 @@ const expectAriaCoordinate = (
describe(' - Keyboard', () => {
const { render } = createRenderer({ clock: 'fake' });
- const NavigationTestCaseNoScrollX = (
+ function NavigationTestCaseNoScrollX(
props: Omit<
DataGridProps,
'autoHeight' | 'rows' | 'columns' | 'pageSize' | 'rowsPerPageOptions'
> & {},
- ) => {
+ ) {
const data = useBasicDemoData(100, 3);
const transformColSizes = (columns: GridColumns) =>
columns.map((column) => ({ ...column, width: 60 }));
@@ -63,7 +63,7 @@ describe(' - Keyboard', () => {
/>
);
- };
+ }
/* eslint-disable material-ui/disallow-active-element-as-key-event-target */
describe('cell navigation', () => {
@@ -463,12 +463,12 @@ describe(' - Keyboard', () => {
},
];
- const NavigationTestGroupingCaseNoScrollX = (
+ function NavigationTestGroupingCaseNoScrollX(
props: Omit<
DataGridProps,
'autoHeight' | 'rows' | 'columns' | 'pageSize' | 'rowsPerPageOptions'
> & {},
- ) => {
+ ) {
const data = getBasicGridData(10, 10);
const transformColSizes = (columns: GridColumns) =>
columns.map((column) => ({ ...column, width: 60 }));
@@ -492,7 +492,7 @@ describe(' - Keyboard', () => {
/>
);
- };
+ }
it('should scroll horizontally when navigating between column group headers with arrows', function test() {
if (isJSDOM) {
diff --git a/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx
index 1504d0648ba9b..b6d74f51ae920 100644
--- a/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/layout.DataGrid.test.tsx
@@ -84,14 +84,14 @@ describe(' - Layout & Warnings', () => {
width?: number;
}
- const TestCase = (props: TestCaseProps) => {
+ function TestCase(props: TestCaseProps) {
const { width = 300 } = props;
return (
);
- };
+ }
const { container, setProps } = render( );
let rect;
@@ -598,11 +598,13 @@ describe(' - Layout & Warnings', () => {
});
it('should resize flex: 1 column when changing columnVisibilityModel to avoid exceeding grid width', () => {
- const TestCase = (props: DataGridProps) => (
-
-
-
- );
+ function TestCase(props: DataGridProps) {
+ return (
+
+
+
+ );
+ }
const { setProps } = render(
- Layout & Warnings', () => {
});
it('should be rerender invariant', () => {
- const Test = () => {
+ function Test() {
const columns = [{ field: 'id', headerName: 'ID', flex: 1 }];
return (
);
- };
+ }
const { setProps } = render( );
setProps();
@@ -803,14 +805,14 @@ describe(' - Layout & Warnings', () => {
// A function test counterpart of ScrollbarOverflowVerticalSnap.
it('should not have a horizontal scrollbar if not needed', () => {
- const TestCase = () => {
+ function TestCase() {
const data = useBasicDemoData(100, 1);
return (
);
- };
+ }
render( );
const virtualScroller = document.querySelector('.MuiDataGrid-virtualScroller')!;
// It should not have a horizontal scrollbar
@@ -1070,11 +1072,13 @@ describe(' - Layout & Warnings', () => {
it('should not render the "no rows" overlay when transitioning the loading prop from false to true', () => {
const NoRowsOverlay = spy(() => null);
- const TestCase = (props: Partial) => (
-
-
-
- );
+ function TestCase(props: Partial) {
+ return (
+
+
+
+ );
+ }
const { setProps } = render( );
expect(NoRowsOverlay.callCount).to.equal(0);
setProps({ loading: false, rows: [{ id: 1 }] });
@@ -1083,11 +1087,13 @@ describe(' - Layout & Warnings', () => {
it('should render the "no rows" overlay when changing the loading to false but not changing the rows prop', () => {
const NoRowsOverlay = spy(() => null);
- const TestCase = (props: Partial) => (
-
-
-
- );
+ function TestCase(props: Partial) {
+ return (
+
+
+
+ );
+ }
const rows: DataGridProps['rows'] = [];
const { setProps } = render( );
expect(NoRowsOverlay.callCount).to.equal(0);
diff --git a/packages/grid/x-data-grid/src/tests/pagination.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/pagination.DataGrid.test.tsx
index 19ac349a60484..29a11ffc9a220 100644
--- a/packages/grid/x-data-grid/src/tests/pagination.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/pagination.DataGrid.test.tsx
@@ -23,9 +23,7 @@ const isJSDOM = /jsdom/.test(window.navigator.userAgent);
describe(' - Pagination', () => {
const { render } = createRenderer({ clock: 'fake' });
- const BaselineTestCase = (
- props: Omit & { height?: number },
- ) => {
+ function BaselineTestCase(props: Omit & { height?: number }) {
const { height = 300, ...other } = props;
const basicData = useBasicDemoData(20, 2);
@@ -35,7 +33,7 @@ describe(' - Pagination', () => {
);
- };
+ }
describe('prop: page and onPageChange', () => {
before(function beforeHook() {
@@ -151,7 +149,7 @@ describe(' - Pagination', () => {
});
it('should control page state when the prop and the onChange are set', () => {
- const ControlCase = () => {
+ function ControlCase() {
const [page, setPage] = React.useState(0);
return (
@@ -162,7 +160,7 @@ describe(' - Pagination', () => {
rowsPerPageOptions={[1]}
/>
);
- };
+ }
render( );
@@ -175,7 +173,7 @@ describe(' - Pagination', () => {
it('should go to last page when page is controlled and the current page is greater than the last page', () => {
const onPageChange = spy();
- const TestCasePaginationFilteredData = (props: Partial) => {
+ function TestCasePaginationFilteredData(props: Partial) {
const [page, setPage] = React.useState(1);
const handlePageChange: DataGridProps['onPageChange'] = (newPage) => {
@@ -192,7 +190,7 @@ describe(' - Pagination', () => {
{...props}
/>
);
- };
+ }
const { setProps } = render( );
expect(onPageChange.callCount).to.equal(0);
@@ -337,7 +335,7 @@ describe(' - Pagination', () => {
});
it('should control pageSize state when the prop and the onChange are set', () => {
- const ControlCase = () => {
+ function ControlCase() {
const [pageSize, setPageSize] = React.useState(1);
return (
@@ -348,7 +346,7 @@ describe(' - Pagination', () => {
rowsPerPageOptions={[1, 2, 3]}
/>
);
- };
+ }
render( );
@@ -412,9 +410,9 @@ describe(' - Pagination', () => {
}
});
- const TestCaseAutoPageSize = (
+ function TestCaseAutoPageSize(
props: Omit & { height: number; nbRows: number },
- ) => {
+ ) {
const { height, nbRows, ...other } = props;
const data = useBasicDemoData(nbRows, 10);
@@ -424,7 +422,7 @@ describe(' - Pagination', () => {
);
- };
+ }
it('should give priority to the controlled pageSize', () => {
render( );
@@ -549,7 +547,7 @@ describe(' - Pagination', () => {
});
it('should support server side pagination', () => {
- const ServerPaginationGrid = () => {
+ function ServerPaginationGrid() {
const [rows, setRows] = React.useState([]);
const [page, setPage] = React.useState(0);
@@ -592,7 +590,7 @@ describe(' - Pagination', () => {
/>
);
- };
+ }
render( );
expect(getColumnValues(0)).to.deep.equal(['0']);
diff --git a/packages/grid/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx
index bf2328cfb21ef..6a6eb788fbd91 100644
--- a/packages/grid/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/quickFiltering.DataGrid.test.tsx
@@ -37,13 +37,13 @@ describe(' - Quick Filter', () => {
columns: [{ field: 'brand' }],
};
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
return (
);
- };
+ }
describe('component', () => {
it('should apply filter', () => {
diff --git a/packages/grid/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx
index a3eb9e6c0b2e3..c351ac7ac5f44 100644
--- a/packages/grid/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/rowSelection.DataGrid.test.tsx
@@ -38,16 +38,21 @@ describe(' - Row Selection', () => {
const defaultData = getBasicGridData(4, 2);
- const TestDataGridSelection = (props: Partial) => (
-
-
-
- );
+ function TestDataGridSelection(props: Partial) {
+ return (
+
+
+
+ );
+ }
describe('prop: checkboxSelection = false (single selection)', () => {
it('should select one row at a time on click WITHOUT ctrl or meta pressed', () => {
@@ -701,7 +706,7 @@ describe(' - Row Selection', () => {
});
it('should control selection state when the model and the onChange are set', () => {
- const ControlCase = () => {
+ function ControlCase() {
const [rowSelectionModel, setRowSelectionModel] = React.useState([]);
const handleSelectionChange: DataGridProps['onRowSelectionModelChange'] = (newModel) => {
@@ -719,7 +724,7 @@ describe(' - Row Selection', () => {
checkboxSelection
/>
);
- };
+ }
render( );
expect(getSelectedRowIds()).to.deep.equal([]);
diff --git a/packages/grid/x-data-grid/src/tests/rows.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/rows.DataGrid.test.tsx
index 7774aee84d5c1..309a6e5bd80fc 100644
--- a/packages/grid/x-data-grid/src/tests/rows.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/rows.DataGrid.test.tsx
@@ -67,11 +67,13 @@ describe(' - Rows', () => {
it('should support new dataset', () => {
const { rows, columns } = getBasicGridData(5, 2);
- const Test = (props: Pick) => (
-
-
-
- );
+ function Test(props: Pick) {
+ return (
+
+
+
+ );
+ }
const { setProps } = render( );
expect(getColumnValues(0)).to.deep.equal(['0', '1']);
@@ -82,12 +84,16 @@ describe(' - Rows', () => {
it('should ignore events coming from a portal in the cell', () => {
const handleRowClick = spy();
- const InputCell = () => ;
- const PortalCell = () => (
-
-
-
- );
+ function InputCell() {
+ return ;
+ }
+ function PortalCell() {
+ return (
+
+
+
+ );
+ }
render(
@@ -154,10 +160,10 @@ describe('
- Rows', () => {
});
describe('columnType: actions', () => {
- const TestCase = ({
+ function TestCase({
getActions,
...other
- }: { getActions?: () => JSX.Element[] } & Partial
) => {
+ }: { getActions?: () => JSX.Element[] } & Partial) {
return (
- Rows', () => {
/>
);
- };
+ }
it('should throw an error if getActions is missing', function test() {
if (!isJSDOM) {
@@ -373,7 +379,7 @@ describe(' - Rows', () => {
it('should focus the last button if the clicked button removes itself', () => {
let canDelete = true;
- const Test = () => {
+ function Test() {
return (
@@ -392,7 +398,7 @@ describe(' - Rows', () => {
}
/>
);
- };
+ }
render( );
fireEvent.click(screen.getByRole('menuitem', { name: 'delete' }));
expect(screen.getByRole('menuitem', { name: 'print' })).toHaveFocus();
@@ -424,14 +430,14 @@ describe(' - Rows', () => {
describe('static row height', () => {
const ROW_HEIGHT = 52;
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
const getRowId: GridRowIdGetter = (row) => `${row.clientId}`;
return (
);
- };
+ }
it('should set each row height whe rowHeight prop is used', () => {
const { setProps } = render( );
@@ -522,13 +528,13 @@ describe(' - Rows', () => {
window.ResizeObserver = originalResizeObserver;
});
- const TestCase = (
+ function TestCase(
props: Partial & {
getBioContentHeight: (row: GridRowModel) => number;
height?: number;
width?: number;
},
- ) => {
+ ) {
const { getBioContentHeight, width = 300, height = 300, ...other } = props;
const customCellRenderer = React.useCallback(
@@ -554,7 +560,7 @@ describe(' - Rows', () => {
/>
);
- };
+ }
it('should measure all rows and update the content size', async () => {
const border = 1;
@@ -869,13 +875,13 @@ describe(' - Rows', () => {
describe('prop: getRowSpacing', () => {
const { rows, columns } = getBasicGridData(4, 2);
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
return (
);
- };
+ }
it('should be called with the correct params', () => {
const getRowSpacing = stub().returns({});
diff --git a/packages/grid/x-data-grid/src/tests/sorting.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/sorting.DataGrid.test.tsx
index bf482d41b186e..e893d2dd0a6f6 100644
--- a/packages/grid/x-data-grid/src/tests/sorting.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/sorting.DataGrid.test.tsx
@@ -180,7 +180,7 @@ describe(' - Sorting', () => {
rows: any[];
}
- const TestCase = (props: TestCaseProps) => {
+ function TestCase(props: TestCaseProps) {
const { rows } = props;
return (
@@ -196,7 +196,7 @@ describe(' - Sorting', () => {
/>
);
- };
+ }
const { setProps } = render( );
expect(getColumnValues(0)).to.deep.equal(['Adidas', 'Nike', 'Puma']);
@@ -225,7 +225,7 @@ describe(' - Sorting', () => {
rows: any[];
}
- const TestCase = (props: TestCaseProps) => {
+ function TestCase(props: TestCaseProps) {
const { rows } = props;
return (
@@ -242,7 +242,7 @@ describe(' - Sorting', () => {
/>
);
- };
+ }
const rows = [
{
@@ -266,14 +266,14 @@ describe(' - Sorting', () => {
});
it('should support new dataset', () => {
- const TestCase = (props: DataGridProps) => {
+ function TestCase(props: DataGridProps) {
const { rows, columns } = props;
return (
);
- };
+ }
const { setProps } = render( );
@@ -305,7 +305,7 @@ describe(' - Sorting', () => {
});
it('should support new dataset in control mode', () => {
- const TestCase = (props: DataGridProps) => {
+ function TestCase(props: DataGridProps) {
const { rows, columns } = props;
const [sortModel, setSortModel] = React.useState();
@@ -320,7 +320,7 @@ describe(' - Sorting', () => {
/>
);
- };
+ }
const { setProps } = render( );
@@ -352,13 +352,13 @@ describe(' - Sorting', () => {
});
it('should clear the sorting col when passing an empty sortModel', () => {
- const TestCase = (props: Partial) => {
+ function TestCase(props: Partial) {
return (
);
- };
+ }
const { setProps } = render( );
@@ -368,11 +368,13 @@ describe(' - Sorting', () => {
});
describe('prop: initialState.sorting', () => {
- const Test = (props: Partial) => (
-
-
-
- );
+ function Test(props: Partial) {
+ return (
+
+
+
+ );
+ }
it('should allow to initialize the sortModel', () => {
render(
diff --git a/packages/grid/x-data-grid/src/tests/toolbar.DataGrid.test.tsx b/packages/grid/x-data-grid/src/tests/toolbar.DataGrid.test.tsx
index 23eedd9f8de33..a0665ba0690a2 100644
--- a/packages/grid/x-data-grid/src/tests/toolbar.DataGrid.test.tsx
+++ b/packages/grid/x-data-grid/src/tests/toolbar.DataGrid.test.tsx
@@ -135,11 +135,13 @@ describe(' - Toolbar', () => {
});
it('should apply to the root element a class corresponding to the current density', () => {
- const Test = (props: Partial) => (
-
-
-
- );
+ function Test(props: Partial) {
+ return (
+
+
+
+ );
+ }
const { setProps } = render( );
expect(screen.getByRole('grid')).to.have.class(gridClasses['root--densityStandard']);
setProps({ density: 'compact' });
diff --git a/packages/x-date-pickers-pro/src/tests/testValidation/testTextFieldValidation.tsx b/packages/x-date-pickers-pro/src/tests/testValidation/testTextFieldValidation.tsx
index bda16db8350ed..96bcffbea877a 100644
--- a/packages/x-date-pickers-pro/src/tests/testValidation/testTextFieldValidation.tsx
+++ b/packages/x-date-pickers-pro/src/tests/testValidation/testTextFieldValidation.tsx
@@ -223,10 +223,10 @@ function testTextFieldValidation(ElementToTest, propsToTest, getOptions) {
const { render, withDate, isSingleInput } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
@@ -258,10 +258,10 @@ function testTextFieldValidation(ElementToTest, propsToTest, getOptions) {
const { render, withDate, isSingleInput } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
diff --git a/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx b/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx
index c4f0db7dedb38..fd0edfaab49ac 100644
--- a/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx
+++ b/packages/x-date-pickers/src/DateCalendar/DayCalendar.tsx
@@ -173,7 +173,7 @@ const PickersCalendarWeek = styled('div', {
justifyContent: 'center',
});
-const WrappedDay = ({
+function WrappedDay({
parentProps,
day,
focusableDay,
@@ -191,7 +191,7 @@ const WrappedDay = ({
selectedDays: TDate[];
isDateDisabled: (date: TDate | null) => boolean;
currentMonthNumber: number;
-}) => {
+}) {
const utils = useUtils();
const now = useNow();
@@ -241,7 +241,7 @@ const WrappedDay = ({
aria-current={isToday ? 'date' : undefined}
/>
);
-};
+}
/**
* @ignore - do not document.
diff --git a/packages/x-date-pickers/src/DateCalendar/tests/validation.DateCalendar.test.tsx b/packages/x-date-pickers/src/DateCalendar/tests/validation.DateCalendar.test.tsx
index 3335ae9aadcce..f2a538bab9820 100644
--- a/packages/x-date-pickers/src/DateCalendar/tests/validation.DateCalendar.test.tsx
+++ b/packages/x-date-pickers/src/DateCalendar/tests/validation.DateCalendar.test.tsx
@@ -4,9 +4,9 @@ import { screen, fireEvent } from '@mui/monorepo/test/utils';
import { DateCalendar, DateCalendarProps } from '@mui/x-date-pickers/DateCalendar';
import { createPickerRenderer, adapterToUse } from '../../../../../test/utils/pickers-utils';
-const WrappedDateCalendar = (
+function WrappedDateCalendar(
props: Omit, 'value' | 'onChange'> & { initialValue: TDate },
-) => {
+) {
const { initialValue, ...other } = props;
const [value, setValue] = React.useState(initialValue);
@@ -16,7 +16,7 @@ const WrappedDateCalendar = (
}, []);
return ;
-};
+}
describe(' - Validation', () => {
const { render, clock } = createPickerRenderer({ clock: 'fake' });
diff --git a/packages/x-date-pickers/src/DatePicker/DatePicker.spec.tsx b/packages/x-date-pickers/src/DatePicker/DatePicker.spec.tsx
index 2187bf9696614..e8b54c1688808 100644
--- a/packages/x-date-pickers/src/DatePicker/DatePicker.spec.tsx
+++ b/packages/x-date-pickers/src/DatePicker/DatePicker.spec.tsx
@@ -19,7 +19,7 @@ import { expectType } from '@mui/types';
/>;
// Inference from the state
-const InferTest = () => {
+function InferTest() {
const [value, setValue] = React.useState(moment());
return (
@@ -29,7 +29,7 @@ const InferTest = () => {
renderInput={() => }
/>
);
-};
+}
// Allows inferring from side props
', () => {
});
describe('rendering', () => {
- const ControlledDatePicker = () => {
+ function ControlledDatePicker() {
const [value, setValue] = React.useState(null);
return (
', () => {
onChange={(newValue) => setValue(newValue)}
/>
);
- };
+ }
it('should handle controlled `onChange` in desktop mode', () => {
render( );
diff --git a/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.test.tsx b/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.test.tsx
index 39e427f8c14fa..3dae12dca48fc 100644
--- a/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.test.tsx
+++ b/packages/x-date-pickers/src/DateTimePicker/DateTimePicker.test.tsx
@@ -7,7 +7,7 @@ import { createPickerRenderer, stubMatchMedia } from 'test/utils/pickers-utils';
import describeValidation from '@mui/x-date-pickers/tests/describeValidation';
describe(' ', () => {
- const ControlledDateTimePicker = () => {
+ function ControlledDateTimePicker() {
const [value, setValue] = React.useState(null);
return (
', () => {
onChange={(newValue) => setValue(newValue)}
/>
);
- };
+ }
const { render, clock } = createPickerRenderer({ clock: 'fake' });
diff --git a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.test.tsx
index d67ee8b7ac474..d181478b3d0d7 100644
--- a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.test.tsx
+++ b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePicker.test.tsx
@@ -122,7 +122,7 @@ describe(' ', () => {
});
it('should allow to switch from invalid date to null date in the input', () => {
- const Test = () => {
+ function Test() {
const [value, setValue] = React.useState(null);
return (
@@ -140,7 +140,7 @@ describe(' ', () => {
);
- };
+ }
render( );
diff --git a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePickerLocalization.test.tsx b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePickerLocalization.test.tsx
index 08c2e9596199f..06e6e314cd587 100644
--- a/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePickerLocalization.test.tsx
+++ b/packages/x-date-pickers/src/DesktopDatePicker/DesktopDatePickerLocalization.test.tsx
@@ -32,7 +32,7 @@ describe(' localization', () => {
PickerProps: Partial>;
}
- const Form = (props: FormProps) => {
+ function Form(props: FormProps) {
const { Picker, PickerProps } = props;
const [value, setValue] = React.useState(adapterToUse.date('01/01/2020'));
@@ -44,7 +44,7 @@ describe(' localization', () => {
{...PickerProps}
/>
);
- };
+ }
it(`should set invalid`, () => {
localizedRender(
diff --git a/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.test.tsx b/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.test.tsx
index c85bab12ce27c..60ff5e42af823 100644
--- a/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.test.tsx
+++ b/packages/x-date-pickers/src/LocalizationProvider/LocalizationProvider.test.tsx
@@ -7,11 +7,11 @@ import { useLocalizationContext } from '@mui/x-date-pickers/internals';
import { LocalizationProvider, PickersLocaleText } from '@mui/x-date-pickers';
import { AdapterClassToUse } from 'test/utils/pickers-utils';
-const ContextListener = ({
+function ContextListener({
onContextChange,
}: {
onContextChange: (context: ReturnType) => void;
-}) => {
+}) {
const context = useLocalizationContext();
React.useEffect(() => {
@@ -19,7 +19,7 @@ const ContextListener = ({
}, [onContextChange, context]);
return null;
-};
+}
describe(' ', () => {
const { render } = createRenderer();
diff --git a/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx b/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx
index d811b3b0a3ede..2943f94a262b6 100644
--- a/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx
+++ b/packages/x-date-pickers/src/PickersActionBar/PickersActionBar.tsx
@@ -24,7 +24,7 @@ export interface PickersActionBarProps extends DialogActionsProps {
onSetToday: () => void;
}
-export const PickersActionBar = (props: PickersActionBarProps) => {
+export function PickersActionBar(props: PickersActionBarProps) {
const { onAccept, onClear, onCancel, onSetToday, actions, ...other } = props;
const wrapperVariant = React.useContext(WrapperVariantContext);
@@ -68,4 +68,4 @@ export const PickersActionBar = (props: PickersActionBarProps) => {
});
return {buttons} ;
-};
+}
diff --git a/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.test.tsx b/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.test.tsx
index f8afb83f6dda2..914385edadd8a 100644
--- a/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.test.tsx
+++ b/packages/x-date-pickers/src/StaticDateTimePicker/StaticDateTimePicker.test.tsx
@@ -126,12 +126,14 @@ describe(' ', () => {
});
it('should render custom component', () => {
- const CustomPickerTabs = (props: DateTimePickerTabsProps) => (
-
-
- test-custom-picker-tabs
-
- );
+ function CustomPickerTabs(props: DateTimePickerTabsProps) {
+ return (
+
+
+ test-custom-picker-tabs
+
+ );
+ }
render(
', () => {
- const ControlledTimePicker = () => {
+ function ControlledTimePicker() {
const [value, setValue] = React.useState(null);
return (
', () => {
onChange={(newValue) => setValue(newValue)}
/>
);
- };
+ }
describeConformance(
) => {
+export function PickersModalDialog(props: React.PropsWithChildren) {
const {
children,
onAccept,
@@ -111,4 +111,4 @@ export const PickersModalDialog = (props: React.PropsWithChildren
);
-};
+}
diff --git a/packages/x-date-pickers/src/tests/testValidation/testDayViewValidation.tsx b/packages/x-date-pickers/src/tests/testValidation/testDayViewValidation.tsx
index e0c587e3e2233..e1360c2a8d216 100644
--- a/packages/x-date-pickers/src/tests/testValidation/testDayViewValidation.tsx
+++ b/packages/x-date-pickers/src/tests/testValidation/testDayViewValidation.tsx
@@ -94,10 +94,10 @@ function testDayViewValidation(ElementToTest, propsToTest, getOptions) {
const { render, clock } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
const tomorrow = adapterToUse.addDays(now, 1);
@@ -130,10 +130,10 @@ function testDayViewValidation(ElementToTest, propsToTest, getOptions) {
const { render, clock } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
const tomorrow = adapterToUse.addDays(now, 1);
diff --git a/packages/x-date-pickers/src/tests/testValidation/testMonthViewValidation.tsx b/packages/x-date-pickers/src/tests/testValidation/testMonthViewValidation.tsx
index 1b9a91a380080..b6bea998392b3 100644
--- a/packages/x-date-pickers/src/tests/testValidation/testMonthViewValidation.tsx
+++ b/packages/x-date-pickers/src/tests/testValidation/testMonthViewValidation.tsx
@@ -43,10 +43,10 @@ function testMonthViewValidation(ElementToTest, propsToTest, getOptions) {
const { render, clock } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
const nextMonth = adapterToUse.addMonths(now, 1);
@@ -81,10 +81,10 @@ function testMonthViewValidation(ElementToTest, propsToTest, getOptions) {
const { render, clock } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
const nextMonth = adapterToUse.addMonths(now, 1);
diff --git a/packages/x-date-pickers/src/tests/testValidation/testTextFieldValidation.tsx b/packages/x-date-pickers/src/tests/testValidation/testTextFieldValidation.tsx
index 66da63d9949c9..200c63a67525a 100644
--- a/packages/x-date-pickers/src/tests/testValidation/testTextFieldValidation.tsx
+++ b/packages/x-date-pickers/src/tests/testValidation/testTextFieldValidation.tsx
@@ -101,10 +101,10 @@ function testTextFieldValidation(ElementToTest, propsToTest, getOptions) {
}
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
@@ -129,10 +129,10 @@ function testTextFieldValidation(ElementToTest, propsToTest, getOptions) {
}
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
const { setProps } = render( );
diff --git a/packages/x-date-pickers/src/tests/testValidation/testYearViewValidation.tsx b/packages/x-date-pickers/src/tests/testValidation/testYearViewValidation.tsx
index 5375001ed3a5c..c6f809f501a15 100644
--- a/packages/x-date-pickers/src/tests/testValidation/testYearViewValidation.tsx
+++ b/packages/x-date-pickers/src/tests/testValidation/testYearViewValidation.tsx
@@ -49,10 +49,10 @@ function testYearViewValidation(ElementToTest, propsToTest, getOptions) {
const { render } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
render( );
const nextYear = adapterToUse.addYears(now, 1);
@@ -75,10 +75,10 @@ function testYearViewValidation(ElementToTest, propsToTest, getOptions) {
const { render } = getOptions();
let now;
- const WithFakeTimer = (props) => {
+ function WithFakeTimer(props) {
now = adapterToUse.date(new Date());
return ;
- };
+ }
render( );
const nextYear = adapterToUse.addYears(now, 1);
diff --git a/scripts/x-data-grid-premium.exports.json b/scripts/x-data-grid-premium.exports.json
index ac5e00735d027..260f59b1921d9 100644
--- a/scripts/x-data-grid-premium.exports.json
+++ b/scripts/x-data-grid-premium.exports.json
@@ -66,7 +66,7 @@
{ "name": "GRID_SINGLE_SELECT_COL_DEF", "kind": "Variable" },
{ "name": "GRID_STRING_COL_DEF", "kind": "Variable" },
{ "name": "GRID_TREE_DATA_GROUPING_FIELD", "kind": "Variable" },
- { "name": "GridActionsCell", "kind": "Variable" },
+ { "name": "GridActionsCell", "kind": "Function" },
{ "name": "GridActionsCellItem", "kind": "Variable" },
{ "name": "GridActionsCellItemProps", "kind": "TypeAlias" },
{ "name": "GridActionsColDef", "kind": "Interface" },
@@ -174,7 +174,7 @@
{ "name": "GridColumnOrderChangeParams", "kind": "Interface" },
{ "name": "GridColumnPinningApi", "kind": "Interface" },
{ "name": "GridColumnPinningInternalCache", "kind": "Interface" },
- { "name": "GridColumnPinningMenuItems", "kind": "Variable" },
+ { "name": "GridColumnPinningMenuItems", "kind": "Function" },
{ "name": "GridColumnPinningState", "kind": "TypeAlias" },
{ "name": "gridColumnPositionsSelector", "kind": "Variable" },
{ "name": "gridColumnReorderDragColSelector", "kind": "Variable" },
@@ -186,7 +186,7 @@
{ "name": "GridColumns", "kind": "TypeAlias" },
{ "name": "GridColumnsGroupingState", "kind": "Interface" },
{ "name": "GridColumnsInitialState", "kind": "Interface" },
- { "name": "GridColumnsMenuItem", "kind": "Variable" },
+ { "name": "GridColumnsMenuItem", "kind": "Function" },
{ "name": "GridColumnsMeta", "kind": "Interface" },
{ "name": "gridColumnsMetaSelector", "kind": "Variable" },
{ "name": "GridColumnsPanel", "kind": "Function" },
@@ -197,12 +197,12 @@
{ "name": "GridColumnVisibilityModel", "kind": "TypeAlias" },
{ "name": "gridColumnVisibilityModelSelector", "kind": "Variable" },
{ "name": "GridComparatorFn", "kind": "TypeAlias" },
- { "name": "GridContextProvider", "kind": "Variable" },
+ { "name": "GridContextProvider", "kind": "Function" },
{ "name": "GridControlledStateEventLookup", "kind": "Interface" },
{ "name": "GridControlledStateReasonLookup", "kind": "Interface" },
{ "name": "GridCoreApi", "kind": "Interface" },
{ "name": "GridCsvExportApi", "kind": "Interface" },
- { "name": "GridCsvExportMenuItem", "kind": "Variable" },
+ { "name": "GridCsvExportMenuItem", "kind": "Function" },
{ "name": "GridCsvExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridCsvExportOptions", "kind": "Interface" },
{ "name": "GridCsvGetRowsToExportParams", "kind": "Interface" },
@@ -228,7 +228,7 @@
{ "name": "gridDetailPanelExpandedRowsHeightCacheSelector", "kind": "Variable" },
{ "name": "GridDetailPanelInitialState", "kind": "TypeAlias" },
{ "name": "GridDetailPanelState", "kind": "Interface" },
- { "name": "GridDetailPanelToggleCell", "kind": "Variable" },
+ { "name": "GridDetailPanelToggleCell", "kind": "Function" },
{ "name": "GridDimensions", "kind": "Interface" },
{ "name": "GridDimensionsApi", "kind": "Interface" },
{ "name": "GridDisableVirtualizationApi", "kind": "Interface" },
@@ -258,7 +258,7 @@
{ "name": "GridEventPublisher", "kind": "TypeAlias" },
{ "name": "GridEvents", "kind": "TypeAlias" },
{ "name": "GridExcelExportApi", "kind": "Interface" },
- { "name": "GridExcelExportMenuItem", "kind": "Variable" },
+ { "name": "GridExcelExportMenuItem", "kind": "Function" },
{ "name": "GridExcelExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridExcelExportOptions", "kind": "Interface" },
{ "name": "GridExceljsProcessInput", "kind": "Interface" },
@@ -300,7 +300,7 @@
{ "name": "GridFilterItem", "kind": "Interface" },
{ "name": "GridFilterItemProps", "kind": "Interface" },
{ "name": "GridFilterListIcon", "kind": "Variable" },
- { "name": "GridFilterMenuItem", "kind": "Variable" },
+ { "name": "GridFilterMenuItem", "kind": "Function" },
{ "name": "GridFilterModel", "kind": "Interface" },
{ "name": "gridFilterModelSelector", "kind": "Variable" },
{ "name": "GridFilterOperator", "kind": "Interface" },
@@ -341,7 +341,7 @@
{ "name": "GridLoadingOverlay", "kind": "Variable" },
{ "name": "GridLocaleText", "kind": "Interface" },
{ "name": "GridLocaleTextApi", "kind": "Interface" },
- { "name": "GridMenu", "kind": "Variable" },
+ { "name": "GridMenu", "kind": "Function" },
{ "name": "GridMenuIcon", "kind": "Variable" },
{ "name": "GridMenuParams", "kind": "Interface" },
{ "name": "GridMenuProps", "kind": "Interface" },
@@ -388,7 +388,7 @@
{ "name": "GridPreferencesPanelApi", "kind": "Interface" },
{ "name": "GridPreProcessEditCellProps", "kind": "Interface" },
{ "name": "GridPrintExportApi", "kind": "Interface" },
- { "name": "GridPrintExportMenuItem", "kind": "Variable" },
+ { "name": "GridPrintExportMenuItem", "kind": "Function" },
{ "name": "GridPrintExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridPrintExportOptions", "kind": "Interface" },
{ "name": "gridQuickFilterValuesSelector", "kind": "Variable" },
@@ -519,7 +519,7 @@
{ "name": "gridTotalHeaderHeightSelector", "kind": "Variable" },
{ "name": "GridTranslationKeys", "kind": "TypeAlias" },
{ "name": "GridTreeBasicNode", "kind": "Interface" },
- { "name": "GridTreeDataGroupingCell", "kind": "Variable" },
+ { "name": "GridTreeDataGroupingCell", "kind": "Function" },
{ "name": "GridTreeNode", "kind": "TypeAlias" },
{ "name": "GridTreeNodeWithRender", "kind": "TypeAlias" },
{ "name": "GridTripleDotsVerticalIcon", "kind": "Variable" },
@@ -543,7 +543,7 @@
{ "name": "gridVisibleSortedTopLevelRowEntriesSelector", "kind": "Variable" },
{ "name": "gridVisibleTopLevelRowCountSelector", "kind": "Variable" },
{ "name": "heIL", "kind": "Variable" },
- { "name": "HideGridColMenuItem", "kind": "Variable" },
+ { "name": "HideGridColMenuItem", "kind": "Function" },
{ "name": "huHU", "kind": "Variable" },
{ "name": "isLeaf", "kind": "Function" },
{ "name": "itIT", "kind": "Variable" },
@@ -570,7 +570,7 @@
{ "name": "selectedGridRowsSelector", "kind": "Variable" },
{ "name": "selectedIdsLookupSelector", "kind": "Variable" },
{ "name": "skSK", "kind": "Variable" },
- { "name": "SortGridMenuItems", "kind": "Variable" },
+ { "name": "SortGridMenuItems", "kind": "Function" },
{ "name": "SUBMIT_FILTER_DATE_STROKE_TIME", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_STROKE_TIME", "kind": "Variable" },
{ "name": "svSE", "kind": "Variable" },
diff --git a/scripts/x-data-grid-pro.exports.json b/scripts/x-data-grid-pro.exports.json
index 9ca45abab7ffc..b492a79086691 100644
--- a/scripts/x-data-grid-pro.exports.json
+++ b/scripts/x-data-grid-pro.exports.json
@@ -60,7 +60,7 @@
{ "name": "GRID_SINGLE_SELECT_COL_DEF", "kind": "Variable" },
{ "name": "GRID_STRING_COL_DEF", "kind": "Variable" },
{ "name": "GRID_TREE_DATA_GROUPING_FIELD", "kind": "Variable" },
- { "name": "GridActionsCell", "kind": "Variable" },
+ { "name": "GridActionsCell", "kind": "Function" },
{ "name": "GridActionsCellItem", "kind": "Variable" },
{ "name": "GridActionsCellItemProps", "kind": "TypeAlias" },
{ "name": "GridActionsColDef", "kind": "Interface" },
@@ -153,7 +153,7 @@
{ "name": "GridColumnOrderChangeParams", "kind": "Interface" },
{ "name": "GridColumnPinningApi", "kind": "Interface" },
{ "name": "GridColumnPinningInternalCache", "kind": "Interface" },
- { "name": "GridColumnPinningMenuItems", "kind": "Variable" },
+ { "name": "GridColumnPinningMenuItems", "kind": "Function" },
{ "name": "GridColumnPinningState", "kind": "TypeAlias" },
{ "name": "gridColumnPositionsSelector", "kind": "Variable" },
{ "name": "gridColumnReorderDragColSelector", "kind": "Variable" },
@@ -165,7 +165,7 @@
{ "name": "GridColumns", "kind": "TypeAlias" },
{ "name": "GridColumnsGroupingState", "kind": "Interface" },
{ "name": "GridColumnsInitialState", "kind": "Interface" },
- { "name": "GridColumnsMenuItem", "kind": "Variable" },
+ { "name": "GridColumnsMenuItem", "kind": "Function" },
{ "name": "GridColumnsMeta", "kind": "Interface" },
{ "name": "gridColumnsMetaSelector", "kind": "Variable" },
{ "name": "GridColumnsPanel", "kind": "Function" },
@@ -176,12 +176,12 @@
{ "name": "GridColumnVisibilityModel", "kind": "TypeAlias" },
{ "name": "gridColumnVisibilityModelSelector", "kind": "Variable" },
{ "name": "GridComparatorFn", "kind": "TypeAlias" },
- { "name": "GridContextProvider", "kind": "Variable" },
+ { "name": "GridContextProvider", "kind": "Function" },
{ "name": "GridControlledStateEventLookup", "kind": "Interface" },
{ "name": "GridControlledStateReasonLookup", "kind": "Interface" },
{ "name": "GridCoreApi", "kind": "Interface" },
{ "name": "GridCsvExportApi", "kind": "Interface" },
- { "name": "GridCsvExportMenuItem", "kind": "Variable" },
+ { "name": "GridCsvExportMenuItem", "kind": "Function" },
{ "name": "GridCsvExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridCsvExportOptions", "kind": "Interface" },
{ "name": "GridCsvGetRowsToExportParams", "kind": "Interface" },
@@ -207,7 +207,7 @@
{ "name": "gridDetailPanelExpandedRowsHeightCacheSelector", "kind": "Variable" },
{ "name": "GridDetailPanelInitialState", "kind": "TypeAlias" },
{ "name": "GridDetailPanelState", "kind": "Interface" },
- { "name": "GridDetailPanelToggleCell", "kind": "Variable" },
+ { "name": "GridDetailPanelToggleCell", "kind": "Function" },
{ "name": "GridDimensions", "kind": "Interface" },
{ "name": "GridDimensionsApi", "kind": "Interface" },
{ "name": "GridDisableVirtualizationApi", "kind": "Interface" },
@@ -274,7 +274,7 @@
{ "name": "GridFilterItem", "kind": "Interface" },
{ "name": "GridFilterItemProps", "kind": "Interface" },
{ "name": "GridFilterListIcon", "kind": "Variable" },
- { "name": "GridFilterMenuItem", "kind": "Variable" },
+ { "name": "GridFilterMenuItem", "kind": "Function" },
{ "name": "GridFilterModel", "kind": "Interface" },
{ "name": "gridFilterModelSelector", "kind": "Variable" },
{ "name": "GridFilterOperator", "kind": "Interface" },
@@ -312,7 +312,7 @@
{ "name": "GridLoadingOverlay", "kind": "Variable" },
{ "name": "GridLocaleText", "kind": "Interface" },
{ "name": "GridLocaleTextApi", "kind": "Interface" },
- { "name": "GridMenu", "kind": "Variable" },
+ { "name": "GridMenu", "kind": "Function" },
{ "name": "GridMenuIcon", "kind": "Variable" },
{ "name": "GridMenuParams", "kind": "Interface" },
{ "name": "GridMenuProps", "kind": "Interface" },
@@ -359,7 +359,7 @@
{ "name": "GridPreferencesPanelApi", "kind": "Interface" },
{ "name": "GridPreProcessEditCellProps", "kind": "Interface" },
{ "name": "GridPrintExportApi", "kind": "Interface" },
- { "name": "GridPrintExportMenuItem", "kind": "Variable" },
+ { "name": "GridPrintExportMenuItem", "kind": "Function" },
{ "name": "GridPrintExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridPrintExportOptions", "kind": "Interface" },
{ "name": "gridQuickFilterValuesSelector", "kind": "Variable" },
@@ -482,7 +482,7 @@
{ "name": "gridTotalHeaderHeightSelector", "kind": "Variable" },
{ "name": "GridTranslationKeys", "kind": "TypeAlias" },
{ "name": "GridTreeBasicNode", "kind": "Interface" },
- { "name": "GridTreeDataGroupingCell", "kind": "Variable" },
+ { "name": "GridTreeDataGroupingCell", "kind": "Function" },
{ "name": "GridTreeNode", "kind": "TypeAlias" },
{ "name": "GridTreeNodeWithRender", "kind": "TypeAlias" },
{ "name": "GridTripleDotsVerticalIcon", "kind": "Variable" },
@@ -506,7 +506,7 @@
{ "name": "gridVisibleSortedTopLevelRowEntriesSelector", "kind": "Variable" },
{ "name": "gridVisibleTopLevelRowCountSelector", "kind": "Variable" },
{ "name": "heIL", "kind": "Variable" },
- { "name": "HideGridColMenuItem", "kind": "Variable" },
+ { "name": "HideGridColMenuItem", "kind": "Function" },
{ "name": "huHU", "kind": "Variable" },
{ "name": "isLeaf", "kind": "Function" },
{ "name": "itIT", "kind": "Variable" },
@@ -533,7 +533,7 @@
{ "name": "selectedGridRowsSelector", "kind": "Variable" },
{ "name": "selectedIdsLookupSelector", "kind": "Variable" },
{ "name": "skSK", "kind": "Variable" },
- { "name": "SortGridMenuItems", "kind": "Variable" },
+ { "name": "SortGridMenuItems", "kind": "Function" },
{ "name": "SUBMIT_FILTER_DATE_STROKE_TIME", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_STROKE_TIME", "kind": "Variable" },
{ "name": "svSE", "kind": "Variable" },
diff --git a/scripts/x-data-grid.exports.json b/scripts/x-data-grid.exports.json
index 62e22f3a756fa..d1f2fb2b56c85 100644
--- a/scripts/x-data-grid.exports.json
+++ b/scripts/x-data-grid.exports.json
@@ -55,7 +55,7 @@
{ "name": "GRID_ROOT_GROUP_ID", "kind": "Variable" },
{ "name": "GRID_SINGLE_SELECT_COL_DEF", "kind": "Variable" },
{ "name": "GRID_STRING_COL_DEF", "kind": "Variable" },
- { "name": "GridActionsCell", "kind": "Variable" },
+ { "name": "GridActionsCell", "kind": "Function" },
{ "name": "GridActionsCellItem", "kind": "Variable" },
{ "name": "GridActionsCellItemProps", "kind": "TypeAlias" },
{ "name": "GridActionsColDef", "kind": "Interface" },
@@ -151,7 +151,7 @@
{ "name": "GridColumns", "kind": "TypeAlias" },
{ "name": "GridColumnsGroupingState", "kind": "Interface" },
{ "name": "GridColumnsInitialState", "kind": "Interface" },
- { "name": "GridColumnsMenuItem", "kind": "Variable" },
+ { "name": "GridColumnsMenuItem", "kind": "Function" },
{ "name": "GridColumnsMeta", "kind": "Interface" },
{ "name": "gridColumnsMetaSelector", "kind": "Variable" },
{ "name": "GridColumnsPanel", "kind": "Function" },
@@ -162,12 +162,12 @@
{ "name": "GridColumnVisibilityModel", "kind": "TypeAlias" },
{ "name": "gridColumnVisibilityModelSelector", "kind": "Variable" },
{ "name": "GridComparatorFn", "kind": "TypeAlias" },
- { "name": "GridContextProvider", "kind": "Variable" },
+ { "name": "GridContextProvider", "kind": "Function" },
{ "name": "GridControlledStateEventLookup", "kind": "Interface" },
{ "name": "GridControlledStateReasonLookup", "kind": "Interface" },
{ "name": "GridCoreApi", "kind": "Interface" },
{ "name": "GridCsvExportApi", "kind": "Interface" },
- { "name": "GridCsvExportMenuItem", "kind": "Variable" },
+ { "name": "GridCsvExportMenuItem", "kind": "Function" },
{ "name": "GridCsvExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridCsvExportOptions", "kind": "Interface" },
{ "name": "GridCsvGetRowsToExportParams", "kind": "Interface" },
@@ -252,7 +252,7 @@
{ "name": "GridFilterItem", "kind": "Interface" },
{ "name": "GridFilterItemProps", "kind": "Interface" },
{ "name": "GridFilterListIcon", "kind": "Variable" },
- { "name": "GridFilterMenuItem", "kind": "Variable" },
+ { "name": "GridFilterMenuItem", "kind": "Function" },
{ "name": "GridFilterModel", "kind": "Interface" },
{ "name": "gridFilterModelSelector", "kind": "Variable" },
{ "name": "GridFilterOperator", "kind": "Interface" },
@@ -288,7 +288,7 @@
{ "name": "GridLoadingOverlay", "kind": "Variable" },
{ "name": "GridLocaleText", "kind": "Interface" },
{ "name": "GridLocaleTextApi", "kind": "Interface" },
- { "name": "GridMenu", "kind": "Variable" },
+ { "name": "GridMenu", "kind": "Function" },
{ "name": "GridMenuIcon", "kind": "Variable" },
{ "name": "GridMenuParams", "kind": "Interface" },
{ "name": "GridMenuProps", "kind": "Interface" },
@@ -331,7 +331,7 @@
{ "name": "GridPreferencesPanelApi", "kind": "Interface" },
{ "name": "GridPreProcessEditCellProps", "kind": "Interface" },
{ "name": "GridPrintExportApi", "kind": "Interface" },
- { "name": "GridPrintExportMenuItem", "kind": "Variable" },
+ { "name": "GridPrintExportMenuItem", "kind": "Function" },
{ "name": "GridPrintExportMenuItemProps", "kind": "TypeAlias" },
{ "name": "GridPrintExportOptions", "kind": "Interface" },
{ "name": "gridQuickFilterValuesSelector", "kind": "Variable" },
@@ -472,7 +472,7 @@
{ "name": "gridVisibleSortedTopLevelRowEntriesSelector", "kind": "Variable" },
{ "name": "gridVisibleTopLevelRowCountSelector", "kind": "Variable" },
{ "name": "heIL", "kind": "Variable" },
- { "name": "HideGridColMenuItem", "kind": "Variable" },
+ { "name": "HideGridColMenuItem", "kind": "Function" },
{ "name": "huHU", "kind": "Variable" },
{ "name": "isLeaf", "kind": "Function" },
{ "name": "itIT", "kind": "Variable" },
@@ -499,7 +499,7 @@
{ "name": "selectedGridRowsSelector", "kind": "Variable" },
{ "name": "selectedIdsLookupSelector", "kind": "Variable" },
{ "name": "skSK", "kind": "Variable" },
- { "name": "SortGridMenuItems", "kind": "Variable" },
+ { "name": "SortGridMenuItems", "kind": "Function" },
{ "name": "SUBMIT_FILTER_DATE_STROKE_TIME", "kind": "Variable" },
{ "name": "SUBMIT_FILTER_STROKE_TIME", "kind": "Variable" },
{ "name": "svSE", "kind": "Variable" },
diff --git a/test/e2e/fixtures/DataGrid/NoRowsOverlayWithButton.tsx b/test/e2e/fixtures/DataGrid/NoRowsOverlayWithButton.tsx
index 2d662dea40e6e..87c543af1f064 100644
--- a/test/e2e/fixtures/DataGrid/NoRowsOverlayWithButton.tsx
+++ b/test/e2e/fixtures/DataGrid/NoRowsOverlayWithButton.tsx
@@ -3,7 +3,7 @@ import { DataGrid } from '@mui/x-data-grid';
const columns = [{ field: 'brand', width: 100 }];
-const NoRowsOverlay = () => {
+function NoRowsOverlay() {
const [text, setText] = React.useState('Refresh');
return (
@@ -11,14 +11,12 @@ const NoRowsOverlay = () => {
{text}
);
-};
+}
export default function NoRowsOverlayWithButton() {
return (
-
-
-
-
-
+
+
+
);
}
diff --git a/test/e2e/fixtures/DataGrid/SelectEditCell.tsx b/test/e2e/fixtures/DataGrid/SelectEditCell.tsx
index efb959ee944c4..9b2eaa7162053 100644
--- a/test/e2e/fixtures/DataGrid/SelectEditCell.tsx
+++ b/test/e2e/fixtures/DataGrid/SelectEditCell.tsx
@@ -3,7 +3,7 @@ import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import { DataGrid, GridRenderEditCellParams, useGridApiContext } from '@mui/x-data-grid';
-const SelectEditInputCell = (props: GridRenderEditCellParams) => {
+function SelectEditInputCell(props: GridRenderEditCellParams) {
const { id, value, field } = props;
const apiRef = useGridApiContext();
@@ -20,7 +20,7 @@ const SelectEditInputCell = (props: GridRenderEditCellParams) => {
Gucci
);
-};
+}
function renderSelectEditInputCell(params) {
return ;
diff --git a/test/utils/pickers-utils.tsx b/test/utils/pickers-utils.tsx
index 992bfa46d7061..d6f2781913c52 100644
--- a/test/utils/pickers-utils.tsx
+++ b/test/utils/pickers-utils.tsx
@@ -172,7 +172,7 @@ export const withPickerControls =
Component: React.ComponentType,
) =>
>(defaultProps: DefaultProps) => {
- return (
+ return function WithPickerControls(
props: Omit<
Props,
'value' | 'onChange' | Exclude
@@ -182,7 +182,7 @@ export const withPickerControls =
value?: TValue;
onChange?: any;
},
- ) => {
+ ) {
const { initialValue, value: inValue, onChange, ...other } = props;
const [value, setValue] = useControlled({