Would appreciate if someone could help me solve this. I'm using React 18.2/Typescript, and I've just installed Silevis/Reactgrid. The grid loads, but it keeps throwing me a "t is undefined" error when I double click on the cell to edit it. I don't know if its a React 18.2 version problem, because I had to install Silevis/Reactgrid using the --legacy-peers-deps flag.
The starter code I used is from here : https://reactgrid.com/docs/4.0/1-getting-started/ , I've pasted it below as well.
import * as React from "react";
import { render } from "react-dom";
import { ReactGrid, Column, Row } from "@silevis/reactgrid";
import "@silevis/reactgrid/styles.css";
import "./styles.css";
interface Person {
name: string;
surname: string;
}
const getPeople = (): Person[] => [
{ name: "Thomas", surname: "Goldman" },
{ name: "Susie", surname: "Quattro" },
{ name: "", surname: "" }
];
const getColumns = (): Column[] => [
{ columnId: "name", width: 150 },
{ columnId: "surname", width: 150 }
];
const headerRow: Row = {
rowId: "header",
cells: [
{ type: "header", text: "Name" },
{ type: "header", text: "Surname" }
]
};
const getRows = (people: Person[]): Row[] => [
headerRow,
...people.map<Row>((person, idx) => ({
rowId: idx,
cells: [
{ type: "text", text: person.name },
{ type: "text", text: person.surname }
]
}))
];
function App() {
const [people] = React.useState<Person[]>(getPeople());
const rows = getRows(people);
const columns = getColumns();
return <ReactGrid rows={rows} columns={columns} />;
}
render(<App />, document.getElementById("root"));
The detailed error that shows is :
Ml@http://localhost:3000/static/js/bundle.js:9899:11 updateReducer@http://localhost:3000/static/js/bundle.js:34126:26 useReducer@http://localhost:3000/static/js/bundle.js:35337:20 useReducer@http://localhost:3000/static/js/bundle.js:50736:25 Al@http://localhost:3000/static/js/bundle.js:9923:46 renderWithHooks@http://localhost:3000/static/js/bundle.js:33775:31 updateFunctionComponent@http://localhost:3000/static/js/bundle.js:36975:24 beginWork@http://localhost:3000/static/js/bundle.js:38922:20 beginWork$1@http://localhost:3000/static/js/bundle.js:44670:18 performUnitOfWork@http://localhost:3000/static/js/bundle.js:43828:16 workLoopSync@http://localhost:3000/static/js/bundle.js:43741:26 renderRootSync@http://localhost:3000/static/js/bundle.js:43710:11 recoverFromConcurrentError@http://localhost:3000/static/js/bundle.js:43118:38 performConcurrentWorkOnRoot@http://localhost:3000/static/js/bundle.js:43019:26 workLoop@http://localhost:3000/static/js/bundle.js:52137:46 flushWork@http://localhost:3000/static/js/bundle.js:52111:18 performWorkUntilDeadline@http://localhost:3000/static/js/bundle.js:52395:25 Al@http://localhost:3000/static/js/bundle.js:9919:11 div div n@http://localhost:3000/static/js/bundle.js:10032:29 Dl@http://localhost:3000/static/js/bundle.js:10056:11 ya@http://localhost:3000/static/js/bundle.js:8328:11 n@http://localhost:3000/static/js/bundle.js:8884:29 App@http://localhost:3000/static/js/bundle.js:75:66