rhventures / rhventures/react-native-dropdown-selector
Refactor: Optimize Keyboard.addListener to avoid adding listeners on every render
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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