diff --git a/README.md b/README.md index bdd809f3..9f4cb337 100644 --- a/README.md +++ b/README.md @@ -34,11 +34,10 @@ yarn add ka-table ```js import 'ka-table/style.css'; -import React, { useState } from 'react'; +import React from 'react'; -import { ITableProps, kaReducer, Table } from 'ka-table'; +import { Table } from 'ka-table'; import { DataType, EditingMode, SortingMode } from 'ka-table/enums'; -import { DispatchFunc } from 'ka-table/types'; const dataArray = Array(10) .fill(undefined) @@ -50,29 +49,19 @@ const dataArray = Array(10) id: index, })); -const tablePropsInit: ITableProps = { - columns: [ - { key: 'column1', title: 'Column 1', dataType: DataType.String }, - { key: 'column2', title: 'Column 2', dataType: DataType.String }, - { key: 'column3', title: 'Column 3', dataType: DataType.String }, - { key: 'column4', title: 'Column 4', dataType: DataType.String }, - ], - data: dataArray, - editingMode: EditingMode.Cell, - rowKeyField: 'id', - sortingMode: SortingMode.Single, -}; - const OverviewDemo: React.FC = () => { - const [tableProps, changeTableProps] = useState(tablePropsInit); - const dispatch: DispatchFunc = (action) => { - changeTableProps((prevState: ITableProps) => kaReducer(prevState, action)); - }; - return (