How to Set OnPress Function to View in React Native

In react native, we use onPress prop in touchable components to enable pressing functionality. But, what about having an onPress function for the View component itself? This feature is one of the things I was missing when I compare react native to native Android development. If you are using react native version greater than 0.55.3…

How to Check a Variable is Undefined in React Native

While developing mobile apps with react native, chances are high that you may come across some scenarios where the value of the variable you declared becomes undefined. So, how to check if a variable is undefined or not in react native as well as JavaScript? Earlier I have written about how to check undefined property…

How to Convert Text to Upper Case or Lower Case in React Native

Upper case and lower case conversions of text are used for many purposes including form filling and authentication. Converting text to upper case or lower case is pretty easy in react native. You can use the JavaScript methods toLowerCase() as well as toUpperCase() on strings. The usage case of toLowerCase and toUpperCase in react native…

How to Make the Screen Refresh when Navigating Back in React Native (TypeScript)

In this blog post, I show you how to make the screen refresh when you navigate back in react native using react navigation library. Most of the react native projects out there prefer react navigation library for the navigation solutions. Usually, when a user navigates back using the back arrow of the header or hardware…

How to Save and Retrieve JavaScript Objects through AsyncStorage in React Native

AsyncStorage is used to store data in key-value pairs. Plain and small data can be easily stored with AsyncStorage. If you have something big then adding key-value pairs for every bit of information is ineffective. In such cases, you can convert them to JavaScript objects and store them in AsyncStorage. Before saving AsyncStorage you need…