react-native-modalbox
react-native-modalbox copied to clipboard
onOpened() Call Twice
Description:
onOpened()
always call twice while onClosed()
only call once. I tested using public method open()
and update attribute isOpen
to true
. It will give same result, onOpened()
call twice.
Environment: What version of the react SDK are you using? "react": "^16.6.0"
What version of the react-native SDK are you using? "react-native": "^0.57.4"
What version of the react-native-modalbox SDK are you using? "react-native-modalbox": "^1.6.0"
How did you add the SDK to your project (eg. npm)
yarn add react-native-modalbox@latest --save
Android Version: Android Marshmallow 6.0.1
Steps to Reproduce Issue:
- run
react-native init testingmodalbox
- run
yarn add react-native-modalbox@latest --save
- Implement
react-native-modalbox
onApp.js
<Modal
onOpened={()=> {console.log('onopened')}}
onClosed={()=> {console.log('onclosed')}}
ref={this.modal}
style={{backgroundColor:'white', height:100, width:330, borderRadius:4, padding:10, elevation:5}}
swipeToClose={false}
animationDuration={500}
position="center"
backdropPressToClose={false}>
<View>
<Text style={styles.welcome}>Welcome to React Native!</Text>
<Text style={styles.instructions}>To get started, edit App.js</Text>
<Text style={styles.instructions}>{instructions}</Text>
</View>
</Modal>
- Look at log, you will find
onopened
print twice.
Anyone face the same issue here?
Same for me. react-native-modalbox: 1.7.1
Any update on this?