反应吐司网格滚动顶部会发生什么

问题描述 投票:0回答:1

从 'react' 导入 React, { useMemo, useCallback, useState, useEffect };

从 '@mui/material' 导入 { Box, Typography, Button };

从'@toast-ui/react-grid'导入TuiGrid;

导入'tui-grid/dist/tui-grid.css';

导入“tui-pagination/dist/tui-pagination.css”;

const Grid = React.memo(({ url, columnData, height, title, menuId, objId, titleAlign, qId }) => {

常量样本数据 = [

"

{ id:1,姓名:'홍길동',年龄:30,电子邮件:'[电子邮件受保护]' },

\n"

{ id: 2, 姓名: '김철수', 年龄: 25, 电子邮件: '[电子邮件受保护]' },

// ... 추і 데і터

];

常量列 = [

{ 标题: '아디', 名称: 'id', 宽度: 100 },

{ 标题: '름', 名称: '名称', 宽度: 150 },

{ header: '나 Been', name: 'age', width: 100 },

{ header: ' Beeno메일', name: 'email', width: 200 }

];

返回(

<>

{标题}

数据={样本数据}

列={列}

标题高度={40}

身体高度={高度}

分页={true}

页面选项={{

useClient:true,

每页:10

}}

/>

);

});

导出默认网格;

在 Toast-Grid React 版本中写完这个之后,

在页面显示的部分或列的边缘右键单击,

无法读取 null 的属性(读取“scrollTop”)

类型错误:无法读取 null 的属性(读取“scrollTop”)

在 ContainerComp._this.handleContextMenu [作为上下文菜单] (http://127.0.0.1:3000/static/js/bundle.js:110558:36)

在 HTMLDivElement.eventProxy (http://127.0.0.1:3000/static/js/bundle.js:89448:37)

我收到此错误,但无论我如何努力都找不到它,我也不知道为什么..

请专家们帮帮我ㅠㅠ

我不知道这个问题

html reactjs frontend scrolltop tui
1个回答
0
投票

名为 TuiGrid 的库似乎已安装并渲染。 尝试使用 useEffect 使其在首次安装时渲染。

useEffect(() => {

}, [])
© www.soinside.com 2019 - 2024. All rights reserved.