Skip to content

Commit a4bf443

Browse files
authored
docs: Add FAQ to popconfirm (ant-design#48055)
1 parent 87debac commit a4bf443

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

components/popconfirm/index.en-US.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ Consult [Tooltip's documentation](/components/tooltip/#api) to find more APIs.
5454

5555
<ComponentTokenTable component="Popconfirm"></ComponentTokenTable>
5656

57+
## FAQ
58+
59+
### Why does the warning findDOMNode is deprecated some times appear in strict mode?
60+
61+
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.
62+
5763
## Note
5864

5965
Please ensure that the child node of `Popconfirm` accepts `onMouseEnter`, `onMouseLeave`, `onFocus`, `onClick` events.

components/popconfirm/index.zh-CN.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ demo:
5555

5656
<ComponentTokenTable component="Popconfirm"></ComponentTokenTable>
5757

58+
## FAQ
59+
60+
### 为何在严格模式中有时候会出现 findDOMNode is deprecated 这个警告?
61+
62+
这是由于 `rc-trigger` 的实现方式导致的,`rc-trigger` 强制要求 children 能够接受 ref,否则就会 fallback 到 findDOMNode,所以 children 需要是原生 html 标签,如果不是,则需要使用 `React.forwardRef``ref` 透传到原生 html 标签。
63+
5864
## 注意
5965

6066
请确保 `Popconfirm` 的子元素能接受 `onMouseEnter``onMouseLeave``onFocus``onClick` 事件。

0 commit comments

Comments
 (0)