是否有使用 grid.js 的 React 示例?有错误
import React from 'react';
import { Grid } from 'gridjs';
export const TableNew = () => {
const grid = new Grid({
columns: ['Weekly', 'Fortnightly', 'Monthly', 'Annually'],
data: () => [
['Pay', 0, 0, 0],
['Taxable Income', 0, 0, 0],
['Taxes', 0, 0, 0],
],
});
console.log('grid', grid);
return <div>{grid}</div>;
};
错误:错误:对象作为 React 子项无效(找到:带有键 {_config} 的对象)。如果您打算渲染一组子项,请改用数组。在 div 中(在 TableNew.jsx:15)