Reader small image

You're reading from  Professional React Native

Product typeBook
Published inOct 2022
Reading LevelIntermediate
PublisherPackt
ISBN-139781800563681
Edition1st Edition
Languages
Right arrow
Author (1)
Alexander Benedikt Kuttig
Alexander Benedikt Kuttig
author image
Alexander Benedikt Kuttig

Alexander Benedikt Kuttig has a master's degree in computer science and currently works as a software and app architect. With plenty of industry experience, he has created app architecture for different industries, such as education, sports and fitness, manufacturing, printing, and banking, which have been used by millions of users across the globe. He runs multiple businesses, such as Horizon Alpha, an app development agency, and Teamfit, a digital corporate health platform. He also speaks about his work at different conferences, such as RNEU and the Geekle Cross-Platform Summit, and has a blog on Medium, which he uses to write about the challenges he faces. Alexander is highly experienced as a React Native developer, speaker, and contributor.
Read more about Alexander Benedikt Kuttig

Right arrow

Comparing local component state and global application state

If you want to provide some data to be shown in your UI, you must store it in your state in most scenarios. But the interesting question is: In which state? Local component state or global application state?

This is a topic that has no simple answer or rules that fit every situation. However, I want to give you some guidelines so that you can make a good decision for all of your use cases:

  • Keep your global state as lean as possible: Global variables are something that is very uncommon to use in most programming languages. And this is for a reason. If everything can be set anywhere in your application, it is hard to debug and maintain it. Also, the bigger the global application state grows, the more likely it is that you will run into performance problems.
  • Form data should not be part of the global state: When you provide input fields such as text fields, toggles, date pickers, or anything else, the state of...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Professional React Native
Published in: Oct 2022Publisher: PacktISBN-13: 9781800563681

Author (1)

author image
Alexander Benedikt Kuttig

Alexander Benedikt Kuttig has a master's degree in computer science and currently works as a software and app architect. With plenty of industry experience, he has created app architecture for different industries, such as education, sports and fitness, manufacturing, printing, and banking, which have been used by millions of users across the globe. He runs multiple businesses, such as Horizon Alpha, an app development agency, and Teamfit, a digital corporate health platform. He also speaks about his work at different conferences, such as RNEU and the Geekle Cross-Platform Summit, and has a blog on Medium, which he uses to write about the challenges he faces. Alexander is highly experienced as a React Native developer, speaker, and contributor.
Read more about Alexander Benedikt Kuttig