I use React/Django stack.
Yesterday, I found out the new version of handsontable/react was released few days ago. (https://github.com/handsontable/react-handsontable) I followed the instruction on (https://handsontable.com/docs/7.2.2/frameworks-wrapper-for-react-hot-column.html) and Now I’m getting following error
hotColumn.tsx:7 Uncaught TypeError: Cannot read property 'Component' of undefined
at hotColumn.tsx:7
at hotColumn.tsx:170
at react-handsontable.min.js:27
at react-handsontable.min.js:27
I installed
"@handsontable/react": "3.1.0",
"handsontable": "7.2.1",
"react": "16.10.2",
"react-dom": "16.8.6",
"react-scripts": "3.0.1"
added
<script src="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@handsontable/react/dist/react-handsontable.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/handsontable/dist/handsontable.full.min.css" rel="stylesheet">
and my code looks like
import React from 'react';
import PropTypes from 'prop-types';
import Handsontable from "handsontable";
import { HotTable, HotColumn } from '@handsontable/react';
class HotTest extends React.Component {
constructor(props) {
super(props);
this.state = {
hotData: Handsontable.helper.createSpreadsheetData(10, 10),
secondColumnSettings: {
title: "Second column header",
readOnly: true
}
};
}
render() {
return (
<HotTable
data={this.state.hotData}
licenseKey="non-commercial-and-evaluation"
>
<HotColumn title="First column header" />
<HotColumn settings={this.state.secondColumnSettings} />
</HotTable>
);
}
}
Is there anything that I’m missing or any suggestion?