react-native-modalbox: Open modal performance is slow for Android

Just using the following code for item selection feature. Now i am using doc provided method to open modal. The modal will be shown after 2 seconds which makes UX bad. Any suggestion ? Thanks a lot !

        <Modal
          duration={0}
          style={styles.jumpPageModal}
          ref="jumpPageModal"
          swipeToClose={false}
          swipeArea={0}
          onClosed={this._reactiveSwipeBack.bind()}
        >
          <ScrollView
            contentContainerCustomStyle={styles.jumpPageModalScrollView}
            ref="jumpPageScrollView"
            showsVerticalScrollIndicator={false}
          >
            <View style={styles.jumpPageModalContainer}>
              {this.state.jumpPageOption.map((x, i) => {
                if (this.state.currentPage != i)
                  return (<TouchableOpacity key={i} style={styles.jumpPageOption}><Text>Page {i + 1}</Text></TouchableOpacity>)
                return (<TouchableOpacity onLayout={this._getCurrentPageOptionOffset.bind(this)} key={i} style={styles.jumpPageOption}><Text style={styles.jumpPageOptionSelected}>Page {i + 1}</Text></TouchableOpacity>)
              })}
            </View>
          </ScrollView>
        </Modal>

About this issue

  • Original URL
  • State: open
  • Created 7 years ago
  • Reactions: 5
  • Comments: 24

Most upvoted comments

Even without the debugger it’s lagging on Android.

You can stop Remote JS Debug for test

Same issue in 2022!

Same issue in 2020