import React from 'react'; import { HotTable } from '../src/hotTable'; import { createSpreadsheetData, mockElementDimensions, mountComponentWithRef } from './_helpers'; /** * Worth noting, that although it's possible to use React's Pure Components on renderer components, it doesn't do much, as currently they're recreated on every * Handsontable's `render`. */ describe('React PureComponents', () => { it('should be possible to declare the renderer as PureComponent', async () => { class RendererComponent2 extends React.PureComponent { render(): React.ReactElement { return ( <> value: {this.props.value} ); } } const hotInstance = mountComponentWithRef(( )).hotInstance; expect(hotInstance.getCell(0, 0).innerHTML).toEqual('
value: A1
'); }); /* Editors cannot be declared as PureComponents, as they're derived from the BaseEditorComponent class. */ });