fix: destroyOnClose fails with forceRender
ant-design/ant-design#28847
解决destroyOnClose和forceRender都设置为true时destroyOnClose失效
原因:当forceRender设置为true时,判断是否删除子节点的语句失效
方案:为forceRender增加一层缓存,当第一次打开Modal时设置forceRender为false
此外,感觉antd文档里关于forceRender部分的描述不是很清晰,个人理解为首次未打开Modal可获取其中的dom

觉得可以和dialog的文档稍作同步
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/react-component/dialog/ookx04a0g
✅ Preview: https://dialog-git-fork-helloany-fix-destroyonclose.react-component.vercel.app
Codecov Report
Merging #232 (8f7c630) into master (586bfcb) will increase coverage by
0.06%. The diff coverage is100.00%.
@@ Coverage Diff @@
## master #232 +/- ##
==========================================
+ Coverage 98.10% 98.17% +0.06%
==========================================
Files 6 6
Lines 158 164 +6
Branches 46 47 +1
==========================================
+ Hits 155 161 +6
Misses 2 2
Partials 1 1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/DialogWrap.tsx | 95.45% <100.00%> (+1.33%) |
:arrow_up: |
| src/Dialog/Content/index.tsx | 95.23% <0.00%> (-0.12%) |
:arrow_down: |
| src/Dialog/index.tsx | 100.00% <0.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 586bfcb...8f7c630. Read the comment docs.
3.x 也有这个问题。😳
冲突了
ping @HelloAny