I’m relatively new to React Native and currently working on an Instagram-like app project. One aspect I’m grappling with is understanding how Instagram manages concurrency to ensure real-time updates across different screens. For example, when I bookmark a post from the home feed and then like it from the bookmark screen, the changes are immediately reflected in the home feed. Could someone provide insights into how such concurrency management is achieved in React Native? Any guidance, best practices, or relevant resources would be greatly appreciated.
What I Tried:
I attempted to manage state updates using Redux in my React Native application. Specifically, I aimed to update the state when a user bookmarks a post from the home feed and then likes it from the bookmark screen.
Expected Outcome:
I expected the state updates to reflect in real-time across different screens, ensuring that when a user interacts with a post (e.g., bookmarking or liking), the changes are immediately visible in the home feed without significant delay.
Actual Result:
However, I encountered performance issues, as the Redux updates were taking too much time to propagate. This led to delays in rendering the changes in the home feed screen, and it seemed inefficient as it rerendered the entire home feed rather than just updating the relevant post.
I suspect that either my approach to state management with Redux is flawed, or there might be more efficient methods to handle concurrency in React Native for such real-time updates.
Ravindra Yadav is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.