Skip to content

Commit 712c4e0

Browse files
committed
fix by review
1 parent d1ee8ae commit 712c4e0

4 files changed

Lines changed: 12 additions & 15 deletions

File tree

apps/demos/Demos/FloatingActionButton/Overview/React/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const App = () => {
1919

2020
const selectedChanged = useCallback((e: DataGridTypes.SelectionChangedEvent) => {
2121
setSelectedRowIndex(e.component.getRowIndexByKey(e.selectedRowKeys[0]));
22-
}, [setSelectedRowIndex]);
22+
}, []);
2323

2424
const directionChanged = useCallback((e: SelectBoxTypes.SelectionChangedEvent) => {
2525
config({

apps/demos/Demos/FloatingActionButton/Overview/ReactJs/App.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,9 @@ import {
1313
const App = () => {
1414
const [selectedRowIndex, setSelectedRowIndex] = useState(-1);
1515
const gridRef = useRef(null);
16-
const selectedChanged = useCallback(
17-
(e) => {
18-
setSelectedRowIndex(e.component.getRowIndexByKey(e.selectedRowKeys[0]));
19-
},
20-
[setSelectedRowIndex],
21-
);
16+
const selectedChanged = useCallback((e) => {
17+
setSelectedRowIndex(e.component.getRowIndexByKey(e.selectedRowKeys[0]));
18+
}, []);
2219
const directionChanged = useCallback((e) => {
2320
config({
2421
floatingActionButtonConfig: directions[e.selectedItem],
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.json' {
2+
const value: any;
3+
export default value;
4+
}

apps/demos/Demos/VectorMap/ColorsCustomization/React/App.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@ import VectorMap, {
66
Border,
77
Font,
88
} from 'devextreme-react/vector-map';
9-
import type { ILayerProps, ITooltipProps } from 'devextreme-react/vector-map';
9+
import type { ILayerProps, ITooltipProps, VectorMapTypes } from 'devextreme-react/vector-map';
1010

1111
import * as mapsData from 'devextreme-dist/js/vectormap-data/world.js';
1212
import { countries } from './data.ts';
1313

14-
interface MapLayerElement {
15-
attribute: (name: string) => string;
16-
selected: (value?: boolean) => boolean;
17-
applySettings?: (settings: Record<string, any>) => void;
18-
}
14+
type CountriesKey = keyof typeof countries;
1915

2016
const bounds = [-180, 85, 180, -60];
2117

2218
const customizeLayer: ILayerProps['customize'] = (elements) => {
2319
elements.forEach((element) => {
24-
const name = element.attribute('name') as keyof typeof countries;
20+
const name = element.attribute('name') as CountriesKey;
2521
const country = countries[name];
2622
if (country) {
2723
element.applySettings({
@@ -33,7 +29,7 @@ const customizeLayer: ILayerProps['customize'] = (elements) => {
3329
});
3430
};
3531

36-
const clickHandler = ({ target }: { target: MapLayerElement }) => {
32+
const clickHandler = ({ target }: VectorMapTypes.ClickEvent) => {
3733
const name = target?.attribute('name') as keyof typeof countries;
3834
if (target && countries[name]) {
3935
target.selected(!target.selected());

0 commit comments

Comments
 (0)