How to Add a Country Code Picker with Phone Input in React Native

Phone number authentication is widely used in mobile apps. Country code picker and OTP are important components of Phone number authentication. In this blog post, let’s see how to create a country code picker with phone number input easily in react native. The easiest way to create a country code picker is to use any …

How to Add a Country Code Picker with Phone Input in React Native Read More »

How to Generate Random Colors in React Native

Sometimes, you may want to generate random colors in your react native project. This short tutorial helps you to generate random colors and set them as background colors in react native. You can generate a random color using the following function in JavaScript. In the following react native example, there’s a FlatList with items that …

How to Generate Random Colors in React Native Read More »

How to Prevent taking Screenshots in React Native App (Android)

Mobile users can take screenshots in any app easily. In some scenarios, you may want to prevent users from taking screenshots inside your app. In this tutorial, let’s check how to prevent screenshots in react native app. Please note that this tutorial works only for Android apps created using react native. Go to YourProject/android/app/src/main/java/com/yourproject/MainActivity and …

How to Prevent taking Screenshots in React Native App (Android) Read More »

How to Decrease Brightness of an Image in React Native

Sometimes, you may want to add images and apply some darkness to them. In this short tutorial, let’s check how to bring down the brightness of an image in React Native. The Image component of react native doesn’t allow to have children. Hence, we are using ImageBackground component which allows children. The idea here is …

How to Decrease Brightness of an Image in React Native Read More »

How to Import Color Variables to a File in React Native

It’s always good to have common color variables throughout your react native project. This helps you to manage your colors and usage easily. Even though this seems pretty obvious beginners may not know how to add a color file in react native. For example, create a file named Colors.js in your project. Then add the …

How to Import Color Variables to a File in React Native Read More »

How to Remove console.log from Production in React Native

When you are developing a react native app, it’s usual to use console.log function for debugging purposes. Extensive use of console.log may make your app slow. Hence, it would be good to remove console.log from production. There are libraries such as redux logger which uses console.log. Manually removing console.log is not easy. Luckily, there’s a …

How to Remove console.log from Production in React Native Read More »

How to Fix ‘Expiring Daemon because JVM heap space is exhausted’ React Native Error

When you integrate heavy third-party libraries such as OneSignal, there are chances you face Expiring Daemon because JVM heap space is exhausted error. This error occurs when you try to run your react native project on Android devices. The issue is Android-specific and it’s happening because allocated JVM memory is not enough to build your …

How to Fix ‘Expiring Daemon because JVM heap space is exhausted’ React Native Error Read More »

How to Fix Unrecognized command “start” React Native Error

Nowadays, I face very few issues regarding react native command line. But recently when I executed the react-native start command on the terminal I got the following error. Apparently, this wasn’t a react native issue. It was a mistake from me. I should have executed the npx react-native start command from the project folder and …

How to Fix Unrecognized command “start” React Native Error Read More »

How to Integrate RazorPay Payment Gateway in React Native

Razorpay is a popular payment gateway among developers, especially in India. In this react native tutorial, let’s check how to add the Razorpay payment gateway in your react native project. I assume you have an account with Razorpay. Get test API keys from Settings > API Keys. Real money is not used when you use …

How to Integrate RazorPay Payment Gateway in React Native Read More »