Detect changes in custom renderer

Tags: #<Tag:0x00007efc645c0168>

Is it possible to detect if the cell value has been changed compared to the initial data source in my custom renderer?
I need to change the colour of the cell if the cell has been edited.

function customRenderer(hotInstance, td, row, column, prop, value, cellProperties) {
  Handsontable.renderers.NumericRenderer.apply(this, arguments);
  if (// detect if cell value has changed here) {
      td.style.backgroundColor = myColor;
  }
  return td;
}

Hi @benjamin.zorn

I recommend using afterChange() hook - it is made to detect changes once they happen.
Within that hook, you get an array of changes, which is [row index, column index, old value, new value] so you can make a call to the setCellMeta() method like, this

instance.setCelleta(row index, column index, 'className', 'yourCustomClass');
instance.render() //this is needed to repaint the table and show the background color