mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-29 18:50:00 +08:00
docs: Add FAQ to popconfirm (#48055)
This commit is contained in:
parent
87debac578
commit
a4bf443c01
@ -54,6 +54,12 @@ Consult [Tooltip's documentation](/components/tooltip/#api) to find more APIs.
|
||||
|
||||
<ComponentTokenTable component="Popconfirm"></ComponentTokenTable>
|
||||
|
||||
## FAQ
|
||||
|
||||
### Why does the warning findDOMNode is deprecated some times appear in strict mode?
|
||||
|
||||
This is due to the implementation of `rc-trigger`. `rc-trigger` forces children to accept ref, otherwise it will fall back to findDOMNode, so children need to be native html tags. If not, you need to use `React.forwardRef` transparently passes `ref` to native html tags.
|
||||
|
||||
## Note
|
||||
|
||||
Please ensure that the child node of `Popconfirm` accepts `onMouseEnter`, `onMouseLeave`, `onFocus`, `onClick` events.
|
||||
|
@ -55,6 +55,12 @@ demo:
|
||||
|
||||
<ComponentTokenTable component="Popconfirm"></ComponentTokenTable>
|
||||
|
||||
## FAQ
|
||||
|
||||
### 为何在严格模式中有时候会出现 findDOMNode is deprecated 这个警告?
|
||||
|
||||
这是由于 `rc-trigger` 的实现方式导致的,`rc-trigger` 强制要求 children 能够接受 ref,否则就会 fallback 到 findDOMNode,所以 children 需要是原生 html 标签,如果不是,则需要使用 `React.forwardRef` 把 `ref` 透传到原生 html 标签。
|
||||
|
||||
## 注意
|
||||
|
||||
请确保 `Popconfirm` 的子元素能接受 `onMouseEnter`、`onMouseLeave`、`onFocus`、`onClick` 事件。
|
||||
|
Loading…
Reference in New Issue
Block a user