StackNavigator with List of items extemly slow on Android
jamie78 opened this issue · 2 comments
jamie78 commented
Problem
- On my screen I have 2 companies, for example Lidl and Tesco
- I click on Lidl and detail shows up, where I load some products of company, but Lidl hasnt got any products. (Everything is working fine)
- I go back
- I click on Tesco and load 25 different products of company (Everything is working fine)
- I go back and click again on Lidl, but when i tap on button which include this.props.navigate() function it takes more than 3s to go on detail
My code
- Simple get data from redux and show record in from nativebase compoment
- I'm using map function on this
What i try
- use another component like instead of using external library
- disable all logs
- disable nested navigation (I have main drawer and inside it I have StackNavigator)
Posible solution
- Use modals (bad solution)
- Use another navigation JS library
- Use native navigation
- Best solution is fix this problem :)
My package.json
khanghoang commented
@jamie78 from what I can see, it may not be react-navigation's problem. If you can provide me with a simple example, I can help you to investigate.
jamie78 commented
Hey @khanghoang, I already figured out my issue. You are totally right. I tried to use different navigation library, but my issue occurs again. So it was a render problem. I used nativebase library to make easier with design, but when you render for example 150 items in cards it is a little bit problem for render() method. So I updated my code with simple check statement, if everythink is already loaded then call render() function. So my issue is clear. Hope this will help others. :)