使用 table-render的工具栏 toolbarAction 提示错误 不影响使用 但有顾虑
dk-gif opened this issue · comments
1.依赖仓库的版本(Dependencies versions):
- react:18.2.0
- form-render:none
- table-render: 2.1.4
- antd:5.16.0
2.问题描述(Bug description):
浏览器提示
Warning: findDOMNode is deprecated in StrictMode. findDOMNode was passed an instance of DomWrapper3 which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here:
3.出现问题的 schema demo(Reproduction schema demo):
toolbarAction
4.最小复现 demo(Reproduction demo):
import { useRef } from 'react'
import TableRender from 'table-render'
const Demo = () => {
const tableRef = useRef()
const columns = [
{
title: '酒店名称',
// dataIndex 唯一时,可以省略 key
dataIndex: 'title',
valueType: 'text',
width: '20%'
},
{
title: '酒店地址',
dataIndex: 'address',
ellipsis: true,
copyable: true,
valueType: 'text',
width: '25%'
},
{
title: '酒店状态',
enum: {
open: '营业中',
closed: '已打烊'
},
dataIndex: 'state'
},
{
title: '酒店星级',
dataIndex: 'labels',
width: 90,
valueType: 'tags'
},
{
title: '酒店GMV',
sorter: true,
dataIndex: 'money',
valueType: 'money'
},
{
title: '成立时间',
dataIndex: 'created_at',
valueType: 'date'
}
]
const searchApi = () => {
return undefined
}
return (
<TableRender
ref={tableRef}
scroll={{ x: 1500 }}
request={searchApi}
columns={columns}
pagination={{ pageSize: 2 }}
toolbarAction
/>
)
}
export default Demo
form-render demo https://codesandbox.io/s/unruffled-flower-jl78h
table-render demo https://codesandbox.io/s/sweet-euler-bdoty
fr-generator demo https://codesandbox.io/s/s13sh