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

使用 table-render的工具栏 toolbarAction 提示错误 不影响使用 但有顾虑 #1511

Open
dk-gif opened this issue Apr 1, 2024 · 0 comments
Assignees

Comments

@dk-gif
Copy link

dk-gif commented Apr 1, 2024

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

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

No branches or pull requests

2 participants