Skip to content

Commit

Permalink
Merge pull request #18 from cenkakin/feature/open-when-initially-is-true
Browse files Browse the repository at this point in the history
open modal when it is initially set to true
  • Loading branch information
httnn authored Jan 11, 2017
2 parents df8d5f8 + a6093ea commit cebe8bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ class Modal extends Component {
offset: new Animated.Value(0)
};
}
componentWillMount() {
if (this.props.open) {
this.open();
}
}
componentWillReceiveProps(props) {
if (props.open && props.children !== this.state.children) {
this.setState({children: props.children});
Expand Down

0 comments on commit cebe8bd

Please sign in to comment.