Skip to content

Commit

Permalink
Refactor React DataGrid Simple Array demo (#27670)
Browse files Browse the repository at this point in the history
Signed-off-by: dxArtemiusz <[email protected]>
Co-authored-by: dxArtemiusz <[email protected]>
Co-authored-by: dxArtemiusz <[email protected]>
  • Loading branch information
3 people authored Jul 16, 2024
1 parent 6027f89 commit 078c933
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions apps/demos/Demos/DataGrid/SimpleArray/React/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import DataGrid from 'devextreme-react/data-grid';
import DataGrid, { Column } from 'devextreme-react/data-grid';
import { customers } from './data.ts';

const columns = ['CompanyName', 'City', 'State', 'Phone', 'Fax'];
Expand All @@ -10,7 +10,9 @@ const App = () => (
keyExpr="ID"
defaultColumns={columns}
showBorders={true}
/>
>
{ columns.map((column, index) => <Column dataField={column} key={index} />) }
</DataGrid>
);

export default App;
11 changes: 9 additions & 2 deletions apps/demos/Demos/DataGrid/SimpleArray/ReactJs/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import DataGrid from 'devextreme-react/data-grid';
import DataGrid, { Column } from 'devextreme-react/data-grid';
import { customers } from './data.js';

const columns = ['CompanyName', 'City', 'State', 'Phone', 'Fax'];
Expand All @@ -9,6 +9,13 @@ const App = () => (
keyExpr="ID"
defaultColumns={columns}
showBorders={true}
/>
>
{columns.map((column, index) => (
<Column
dataField={column}
key={index}
/>
))}
</DataGrid>
);
export default App;

0 comments on commit 078c933

Please sign in to comment.