When you start building code to React Native, there are some common issues that you face. When I worked on my first React Native application, I trembled to see that RED screen literally meaning like DANGER So, here, we will be discussing some of the common React Native issues and ways to solve them. Here we go…!
Let’s Begin with your nightmares (well I mean Issues!):
1. App Registry Error in React Native:
As you create your application and run it, you may face an issue stating, “Your App is not registered.” The reason for this lies in your core process while creating application i.e., the application name in your app.json file. Just correcting the name itself will resolve this issue.
2. Development Server Error in React Native:
If you see a screen like as shown in image for Development Server Error, saying “could not connect to the development server,” then it’s an issue with your metro bundler, and you need to restart it to resolve the issue. For this, just close your previous metro bundler => Navigate to “Your Project Directory” => hit command => “npm start” and you are good to go. Again, in another tab, just run “react-native run-android/react-native run-ios” for running your application.
3. Library Error (Packages not installed properly) in React Native:
While using React Native Firebase library, let’s say for Push Notifications, you will get some issues like “FirebaseCore.h not found” or “Firebase.h not found.” For issues like this, its an indication that your library is not properly installed or linked. To resolve these kinds of problems, you just need to re-install and re-link your library manually again instead of linking it automatically.
4. Undefined is not an object error in React Native:
Many times, you will see an error saying “Undefined is not an object,” which just means that some of your references are not adequately defined or declared correctly. The variable it is referring to can be found out in the issue description as shown in image.
5. The module is not found an error in React Native:
Many times, you will create your .js files in a hurry, and while using them, you forget to give correct path and Boom, the issue arises. So don’t get confused, provide the right file path for files, and you will be good to go.
By the way, I love building in React Native. Here are the advantages of React Native App