How to Solve Name Conflict While Importing Two Modules with Same Name in React Native

The name conflict may occur in react native when you import components from react native as well as from any other third-party libraries with the same name. Just have a look at the code snippet given below: As you notice, we have imported two Text components, one from react native and the other from react…

How to Make White StatusBar with Content Shown in React Native

React Native provides a StatusBar component to control your app status bar. You can easily create a white color StatusBar with the following snippet: Yes, there’s a problem with the above snippet, the whole status bar turns to white and you can’t see the content such as the signal, battery, etc. In such cases, you…

How to make iOS Simulator Keyboard shown when Running Apps

By default, you use the keyboard hardware of your mac in your iOS simulator. But you may need to test the behavior of the iOS device keyboard when using your react native app. It is also known that React Native has some keyboard-related issues. Switching from a hardware keyboard to a simulator keyboard is easy….

OnPress Function Fires only after Tapping Twice when Keyboard Present React Native Issue Fix

This is a common react native issue especially when you use TextInput with ScrollView / FlatList as a parent. In such cases, the other components like the button respond only when you click or tap outside of the TextInput twice. To solve this React Native issue, you have to use the keyboardShouldPersistTaps prop with ScrollView…

How to Make an Image Rotate with Animation in React Native

In this React Native tutorial, I show you how to rotate an image continuously in React Native. For Animation, we have to use the Animated library from React Native. In useEffect hook, Animated.loop is used to continue the animation as a loop. We also set Animated.Value as 0 in the state. Animated.timing is used to…

How to Add an Icon inside TextInput in React Native

Sometimes, you may want to show an icon inside your TextInput, specifically saying- an icon aligned to the left of the TextInput. React Native TextInput has inlineImageLeft prop to add an icon inside it. Unfortunately, inlineImageLeft supports only the Android platform. There’s also another prop named inlineImagePadding to adjust the padding of the image inside…