Javascript Jexcel:我如何将updateTable与react一起使用?

Javascript Jexcel:我如何将updateTable与react一起使用?,javascript,reactjs,jexcelapi,jexceljs,Javascript,Reactjs,Jexcelapi,Jexceljs,我有这个问题,我想使用带有react的Jexcel,我们可以传递选项updateTable来管理如何查看单元格,如何渲染,我们有以下参数:instance,cell,col,row,val,id其中instance和cell是本机节点,然后,例如,将条目更改为image,我们可以使用cell.appendChild(…)或cell.innerHTML=…我想知道是否存在使用react组件的正确方法,特别是我想把它放在一个中,它有点击事件来导航到另一个路由(当然使用react路由器dom)。 我的

我有这个问题,我想使用带有react的Jexcel,我们可以传递选项
updateTable
来管理如何查看单元格,如何渲染,我们有以下参数:
instance,cell,col,row,val,id
其中instance和cell是本机节点,然后,例如,将条目更改为image,我们可以使用
cell.appendChild(…)
cell.innerHTML=…
我想知道是否存在使用react组件的正确方法,特别是我想把它放在一个
中,它有点击事件来导航到另一个路由(当然使用react路由器dom)。 我的代码:

类{
.....
updateTable(实例、单元格、列、行、值、id){
如果(列===1){
如果(!val)返回;
/*
*这不起作用:
*设img=;
*附加子细胞(img);
*/
cell.innerHTML=`;
}
}
componentDidMount(){
让选项={
...
结果:1,,
是的,
updateTable:this.updateTable,
懒洋洋:没错
};
this.el=jexcel(this.wrapper.current,opts);
}
.....
}
class ....{
.....
  updateTable(instance, cell, col, row, val, id) {
    if (col === 1) {
      if (!val) return;
      /*
       * this NOT WORKING:
       * let img = <img src={val} style={{ height: 40, width: '100%', objectFit: 'cover' }} />;
       * cell.appendChild(img);
       */
      cell.innerHTML=`<img src="${val}" />`;
    }
  }
  componentDidMount() {
    let opts = {
        ...
        freezeColumns: 1,
        tableOverflow: true,
        updateTable: this.updateTable,
        lazyLoading: true
     };
    this.el = jexcel(this.wrapper.current, opts);
  }
.....
}