当我尝试使用单元格渲染来渲染自定义元素时,
这是我的组件:Action.jsx
import React from 'react';
export default (props) => (
<div>
<button
class="action-button cancel">
cancel
</button>
</div>
);
Run Code Online (Sandbox Code Playgroud)
这是我的网格选项和导入:
import AcRenderer from './Action.jsx'
...
const gridOptions = {
rowData: renderdata(),
columnDefs: [
{
headerName: "action",
cellRenderer: AcRenderer,
editable: false,
colId: "action",
filter: false,
minWidth: 220
}
],
Run Code Online (Sandbox Code Playgroud)
但我不断收到此错误:
” Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.“
有谁知道为什么?
非常感谢!