rhventures / rhventures/react-native-dropdown-selector

Refactor: Optimize Keyboard.addListener to avoid adding listeners on every render

Open
#41 0 comments 1 reaction 0 assignees View on GitHub

@egeakman is already working on this.

Since Dec 19, 2024.

  • #54 by @egeakman — open
bug refactor
Dominant language
TypeScript
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Keyboard listeners are re-added on every re-render in SelectionList. I am not sure how significant of a performance issue this introduces, but it's better if we make it more efficient.

We can use useEffect to efficiently manage keyboard listeners.

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

Start at the SelectionList component and inspect where Keyboard.addListener is called during rendering. Review the proposed useEffect approach and verify that listeners are not recreated on each render and are cleaned up when dependencies change or the component unmounts.

Written by the indexing model from the issue text.

Assessment

Tech stack
react-native, typescript
Domain
mobile
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.