Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Bug】CustomLayout 报错:Cannot destructure property 'col' of 'reactGroup' as it is null #2038

Closed
mzhang-eric opened this issue Jul 4, 2024 · 0 comments · Fixed by #2046
Assignees

Comments

@mzhang-eric
Copy link

复现步骤:

  1. https://visactor.io/vtable/demo-react/custom-layout/cell-custom-layout-dom
    (单元格自定义组件+dom组件)

使用上述官网示例,return 方法中使用如下配置:

<ListTable
      records={records}
      height={900}
      select={
        {
          disableHeaderSelect: true,
        }
      }
      dragHeaderMode="column"
      // rowSeriesNumber={{title: '序号'}}
      ReactDOM={ReactDom}
    >
      <ListColumn field={'bloggerId'} title={'ID'} />
      <ListColumn field={'bloggerName'} title={'Name'} width={220}>
        <UserProfileComponent role={'custom-layout'} />
      </ListColumn>
      <ListColumn field={'fansCount'} title={'Fan'} />
      <ListColumn field={'worksCount'} title={'Work'} />
      <ListColumn field={'viewCount'} title={'View'} />
    </ListTable>
  1. 拖拽表头换位,此时报错:Cannot destructure property 'col' of 'reactGroup' as it is null

  2. 解除上述代码中行序号的配置注释,rowSeriesNumber={{title: '序号'}},此时也会报错:Cannot destructure property 'col' of 'reactGroup' as it is null

【总结】在React项目中使用该示例发现,如果使用了 CustomLayout,此时如果设置行序号,会直接导致页面崩溃,或者进行拖拽行换位也会导致出现相同错误

image

@Rui-Sun Rui-Sun self-assigned this Jul 4, 2024
@Rui-Sun Rui-Sun linked a pull request Jul 5, 2024 that will close this issue
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants