We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When 4.9.1 I can use (visible && <ChildrenContent/>) in Modal, but 4.9.2 is useless. I should use destoryOnClose but too many code to transform.
<ChildrenContent/>
destoryOnClose
I think this commit have an impact on this issue. Please help me. Thanks very much.
优化 Modal useModal 性能,避免元素渲染导致组件渲染。#28122 @TotooriaHyperion
I can use (visible && <ChilerenContent />) to destory my component.
<ChilerenContent />
I can not
The text was updated successfully, but these errors were encountered:
I have the same problem
Sorry, something went wrong.
It's cause by react-component/dialog#212, @zombieJ
@cxyxc #28122 only affects usage of
const [modal] = Modal.useModal(); return <button onClick={() => modal.confirm(...)}>Confirm</button>
check react-component/dialog#212 this wraps content into a MemoChildren, and prevent any update triggered by visible change.
@cxyxc you could use the forceRender to rerender the child:
forceRender
<Dialog forceRender > {visible && <ChildrenContent/>} </Dialog>
@zombieJ @shangyilim I have same problem, react-component/dialog#212, was a breaking change, it broke some my apps where I used to rely that
visible && <ChildrenContent/>
would unmount <ChildrenContent/> on change of visible, but now it doesn't anymore. So it broke my apps where I had that assumption.
visible
Sorry, you should use destoryOnClose in this situation.
zombieJ
No branches or pull requests
Reproduction link
Steps to reproduce
When 4.9.1 I can use (visible &&
<ChildrenContent/>
) in Modal, but 4.9.2 is useless. I should usedestoryOnClose
but too many code to transform.I think this commit have an impact on this issue. Please help me. Thanks very much.
优化 Modal useModal 性能,避免元素渲染导致组件渲染。#28122 @TotooriaHyperion
What is expected?
I can use (visible &&
<ChilerenContent />
) to destory my component.What is actually happening?
I can not
The text was updated successfully, but these errors were encountered: