10 React Native Tips for Beginners, Part 1

10 React Native Tips for Beginners, Part 1
  1. Use useEffect very carefully.

  2. If you are using Expo, Debug more on the Dev client than Expo Go. A lot of libraries that you use will work on Expo Go but not on the dev client.

  3. Never render a Pressable inside a View component that has {alignItems: ‘baseline’} Trust me and save yourself 1 day’s worth of debugging. Somehow it causes the App to crash on iOS.

  4. Remove console statements to improve performance and avoid unnecessary logging in your app. It will cause performance issues.

  5. Use StyleSheet to define styles separately for better performance and organization. Avoid inline styles whenever possible.

  6. Focus more on Functionality than UI. Creating UI according to your designs is easy. Adding functionality as per the requirements is not.

  7. Avoid Nesting navigators as much as possible. If not handled properly, it will cause problems for you as a developer maintaining the code and make the UX confusing for the user.

  8. If you have a List that you want to render, avoid using the .map to render it. This is because mapping over an array is not optimized. React Native will render every single element in the array all at once, regardless of whether they are visible on the screen or not. It will cause performance issues in React Native. In React Web, It’ll work fine.

  9. In an Expo-managed project, When you use external libraries from the npm registry, You are likely to run into various errors that will take you hours to solve or even days. Most of them will be version mismatches, So you can just use the command npx expo install --fix Expo will automatically use the perfect version of the library.

  10. Maximize the use of Hot Reloading, Cross-platform frameworks like Flutter and React Native have Hot Reloading features that can maximize your productivity as a developer.

Did you find this article valuable?

Support Rishikesh Bidkar by becoming a sponsor. Any amount is appreciated!