react-native-modalbox icon indicating copy to clipboard operation
react-native-modalbox copied to clipboard

onOpened() Call Twice

Open abdullahizzuddiin opened this issue 6 years ago • 2 comments

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:

  1. run react-native init testingmodalbox
  2. run yarn add react-native-modalbox@latest --save
  3. Implement react-native-modalbox on App.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>
  1. Look at log, you will find onopened print twice.

Anyone face the same issue here?

abdullahizzuddiin avatar Dec 19 '18 02:12 abdullahizzuddiin

Same for me. react-native-modalbox: 1.7.1

mojtaba-hajishah avatar Apr 28 '19 13:04 mojtaba-hajishah

Any update on this?

dmsierra11 avatar Jul 11 '19 16:07 dmsierra11