Skip to content

Commit 6cef747

Browse files
Update React
1 parent fe1d026 commit 6cef747

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

React/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

React/src/App.tsx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import './App.css';
66
import ArrayStore from 'devextreme/data/array_store';
77
import { type DataSourceOptions } from 'devextreme-react/common/data';
88
import service, { type City, type Employee } from './data';
9-
import MultipleDropDownBox from './components/MultipleDropDownBox';
9+
import MultipleDropDownBox from './components/MultipleDropDownBox.tsx';
1010

1111
const dataSource: Employee[] = service.getEmployees();
1212

@@ -20,9 +20,9 @@ const citiesStore = new ArrayStore({
2020
key: 'ID',
2121
});
2222

23-
function getFilteredCities(cellInfo: DataGridTypes.ColumnEditCellTemplateData<Employee, number>, citiesStore: ArrayStore): DataSourceOptions {
23+
function getFilteredCities(cellInfo: DataGridTypes.ColumnEditCellTemplateData<Employee, number>, store: ArrayStore): DataSourceOptions {
2424
return {
25-
store: citiesStore,
25+
store,
2626
filter: (data: City) => (cellInfo.data?.StateID && cellInfo.data?.StateID?.length > 0
2727
? cellInfo.data?.StateID.includes(data.StateID)
2828
: true),
@@ -45,13 +45,12 @@ function arrayCellTemplate(container: HTMLElement, options: DataGridTypes.Column
4545

4646
function renderMultipleDropDownBox(
4747
currentValue: number[],
48-
// eslint-disable-next-line no-unused-vars
4948
setValue: (value: number[]) => void,
50-
dataSource: ArrayStore | DataSourceOptions,
49+
dropDownDataSource: ArrayStore | DataSourceOptions,
5150
): JSX.Element {
5251
return (
5352
<MultipleDropDownBox
54-
dataSource={dataSource}
53+
dataSource={dropDownDataSource}
5554
value={currentValue}
5655
setValue={setValue}
5756
/>

React/src/components/DropDownBoxSave.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ type DropDownBoxAction =
88

99
interface DropDownBoxSaveProps {
1010
selectedKeys: number[];
11-
// eslint-disable-next-line no-unused-vars
1211
setCellValue: (value: number[]) => void;
1312
setState: React.Dispatch<DropDownBoxAction>;
1413
}

React/src/components/MultipleDropDownBox.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import React, { useCallback, useMemo, useReducer } from 'react';
22
import DataGrid, { Column, Selection, type DataGridTypes } from 'devextreme-react/data-grid';
33
import DropDownBox from 'devextreme-react/drop-down-box';
44
import type { ArrayStore, DataSourceOptions } from 'devextreme-react/common/data';
5-
import DropDownBoxSave from './DropDownBoxSave';
5+
import DropDownBoxSave from './DropDownBoxSave.tsx';
66

77
interface MultipleDropDownBoxProps {
88
value: number[];
99
dataSource: DataSourceOptions | ArrayStore;
10-
// eslint-disable-next-line no-unused-vars
1110
setValue: (newValue: number[]) => void;
1211
}
1312

0 commit comments

Comments
 (0)