GeekyAnts / GeekyAnts/NativeBase

Memory Leak : HybridProvider

Open
#5,547 9 comments 0 reactions 0 assignees View on GitHub
bug triage v3
Dominant language
TypeScript
Stars
20.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

### Description

When you close the app there is a memory leak in useEffect HybridProvider:

### CodeSandbox/Snack link

Private Repo

### Steps to reproduce

1. Open the app
2. Close
3. Error in Metro appears
```
ERROR Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
in HybridProvider (at NativeBaseProvider.tsx:90)
```

### NativeBase Version

3.4.5

### Platform

- [X] Android
- [ ] CRA
- [ ] Expo
- [X] iOS
- [ ] Next

### Other Platform

_No response_

### Additional Information

Project is using RN 0.68.2

Contributor guide

Open the contributing guide

Research direction

Start by reading NativeBaseProvider.tsx around line 90 and trace the HybridProvider useEffect involved in the warning. Reproduce the issue on Android or iOS with React Native 0.68.2, then verify that closing the app no longer produces the unmounted-component warning.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.