u/Desperate_Door1709

Deferred/progressive API calls in react native

Ever implemented deferred/progressive API calls in react native? If yes what is your go to approach?

Do they really help in performance gain?

Note: For those who are confused, I am talking about making api calls progressively based on what users can see on the screen. So basically we only make api calls to fetch the amount of data required to fill the user's screen and as they scroll new data is fetched progressively based on scroll and whether the fetched data fills more than the entire viewport.

I feel like trying to do this from scratch in react native is causing too much complex spaghetti code and rerenders. I am looking for a better way to do this if it exists.

reddit.com
u/Desperate_Door1709 — 7 days ago

I am using bottom-tabs in my react native cli app with custom ui for bottom tabs. I referred custom ui for bottom tabs to build this. But there is this annoying bug. When ever i switch frequently between the tabs at some point the there is a mismatch between the highlighted tab and the screen being rendered. I am not able to figure out the reason why it's happening. Have anyone encountered similar bug? Any suggestions on how to resolve this would be appreciated.

u/Desperate_Door1709 — 9 days ago
▲ 2 r/u_Desperate_Door1709+1 crossposts

I am using Flashlist from shopify/flash-list. currently the api is only returning 3 items. but still the flashlist is taking nearly 80ms for initial load. I have tried to use estimatedItemSize and estimatedListSize props(came across using them as solution in github issues). But realised they were removed from V2. I have tried simplifying the rendering items. Updated them to only render a text component. But still the initial load time hasn't changed. Am i missing something?. Would like it if some knowledge on how to resolve this.

https://preview.redd.it/nngiulhse9zg1.png?width=1272&format=png&auto=webp&s=f2239bde0597442d9d2082b7452f9a0d16417128

https://preview.redd.it/jcmyc5yue9zg1.png?width=638&format=png&auto=webp&s=7e087c016c02eb7c187b2b47ea501114a7f710a6

reddit.com
u/Desperate_Door1709 — 10 days ago