Skip to content

5.11 新增加的table ref 怎么使用的,有没有demo,一升级搞的我之前加的所有的useref的值都不能用了,页面直接报错 #45984

Answered by zombieJ
guanshining asked this question in Q&A
Discussion options

You must be logged in to vote

报错信息是什么能看看不?

tableRef 说明在这里:https://ant-design.antgroup.com/components/table-cn#table-ref

用法就是:

const tableRef = React.useRef<TableRef>();

<Table ref={tableRef} />

tableRef.current.nativeElement // Table DOM
tableRef.current.scrollTo(...) // 滚动到目标位置

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@mrleidesen
Comment options

Answer selected by guanshining
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants