maxs15 / maxs15/react-native-modalbox

Open modal performance is slow for Android

Open
#145 24 comments 5 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
2.9k
Forks
496
PR merge metrics
No merged PRs in 30d

Description

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>

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository file or test is named. Start with the provided Android usage of Modal, ScrollView, and the mapped TouchableOpacity items, then profile the modal-opening and rendering path on Android. Done should include an identified performance cause and a verified improvement in modal opening time.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile-dev, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.