From a6093ea315dc5bb505b39b71e38e9101641a1d10 Mon Sep 17 00:00:00 2001 From: cenkakin Date: Tue, 10 Jan 2017 12:10:00 +0200 Subject: [PATCH] open modal when it is initially set to true --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index 80dfca9..10c68f6 100644 --- a/index.js +++ b/index.js @@ -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});