Skip to content

Reduce the size of your JavaScript bundle by getting rid of redundant Handsontable modules.

Use modules

To reduce the bundle size and JavaScript parsing time, import only those of Handsontable’s modules that you actually use, instead of importing the complete package.

The following example shows how to import and register the ContextMenu plugin on top of the base module of Handsontable, without importing anything else.

import Handsontable from 'handsontable/base';
import { HotTable } from '@handsontable/react-wrapper';
import { registerPlugin, ContextMenu } from 'handsontable/plugins';
registerPlugin(ContextMenu);
const App = () => {
return (
<HotTable
contextMenu={true}
/>
);
};