Skip to content

Commit

Permalink
fix(Modal): handle tigger to re-render in case isOpen is true on init
Browse files Browse the repository at this point in the history
  • Loading branch information
lh0x00 committed May 21, 2019
1 parent 7759cff commit 46504f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Modal.js
Expand Up @@ -100,13 +100,14 @@ class Modal extends React.Component {
this.manageFocusAfterClose = this.manageFocusAfterClose.bind(this);

this.state = {
isOpen: props.isOpen,
isOpen: false,
};
}

componentDidMount() {
if (this.props.isOpen) {
this.init();
this.setState({ isOpen: true })
}

if (this.props.onEnter) {
Expand Down

0 comments on commit 46504f7

Please sign in to comment.