You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wrap Modal into Button component, as in first example
What is expected?
Modal onOk and onClose callbacks have access to state of the parent component so modal could be closed
What is actually happening?
calling this.setState from onOk and onClose does not changes state of the parent component
when the modal is placed outside Button component it works as expected.
You may suggest do not wrap Modal inside Button component. It's not a problem.
The problem is a large codebase written on ant@2.x and full of <Button><Modal></Button> snippets. It's hard to find and it requires adding redundant <div> wrapper which breaks styles sometimes.
The text was updated successfully, but these errors were encountered:
Version
3.0.3
Environment
osx, Chrome
Reproduction link
https://codesandbox.io/s/yn3rzwxn1
Steps to reproduce
Wrap Modal into Button component, as in first example
What is expected?
Modal
onOk
andonClose
callbacks have access to state of the parent component so modal could be closedWhat is actually happening?
calling
this.setState
fromonOk
andonClose
does not changes state of the parent componentwhen the modal is placed outside Button component it works as expected.
You may suggest do not wrap
Modal
insideButton
component. It's not a problem.The problem is a large codebase written on
ant@2.x
and full of<Button><Modal></Button>
snippets. It's hard to find and it requires adding redundant<div>
wrapper which breaks styles sometimes.The text was updated successfully, but these errors were encountered: