Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

110
Views
Best way to use Redux and local state in react native to optimize performance?

I am using redux to manage a global state and sagas for async server calls in a react native app.

Can it improve the performance / minimize rendering to split the calls to redux state when connecting a component to the redux store? E.g. a big object in the redux store is composed of many smaller ones. {bigObject : {small1, small2, small3....}} in mapStateToProps for a class, is it more efficient to make separate calls to each of the smaller objects that are required (small1: state.bigObject.small1), or is it better to have only one call to the larger object ( big: state.bigObject)?

Similarly, can it be good practice to create local state copies of the redux state (e.g. setState for class) or is it better to call the redux state directly in the component (e.g. this.props.state.bigObject.small1) anywhere it is needed? Does it have an impact?

Thanks a lot!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No. Once your state is in memory, it's in memory. Redux is just a fancy object, and object access is in O(1) time. All you would be doing is taking up additional memory and and processing time by duplicating your state. Not to mention the likelihood of bugs from local and global state getting out of sync.

Redux and React are already optimized to solve this problem. Here's a section of the React docs that covers this.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!