As we continue developing the Crowd-Sourced Travel Planner project, I’ve had the opportunity to dive deep into React Native for building the front-end. In this post, I’ll share my thoughts on how React Native fits into the tech stack, what I’ve learned, and why it has become one of my favorite technologies so far.
Favorite Technology: React Native
Without a doubt, React Native has been my favorite technology to work with for this project. As someone with experience in React for web development, transitioning to React Native felt like a natural extension of my skillset. The main appeal of React Native lies in its ability to write cross-platform mobile applications using JavaScript, which means that the same codebase can be used for both iOS and Android. This is a game-changer, as it saves a lot of time and effort in building mobile apps for different platforms.
One of the standout features of React Native is its “live reload” functionality, which lets you see code changes immediately without needing to rebuild the entire app. This feature speeds up the development process significantly. Additionally, React Native’s component-based structure, similar to React for the web, makes it easy to break down the app into manageable pieces that are easy to maintain and debug.
The Technology I Had Difficulty Learning: React Native’s Navigation System
While React Native overall has been great, there was one area where I initially struggled: the navigation system. React Native uses different libraries for navigation, and the learning curve for setting up stack, tab, and drawer navigators was a bit steeper than I anticipated. At first, I found myself getting confused by the various methods of navigating between screens and passing data between them. But after spending more time with the documentation and experimenting with different approaches, I now appreciate how flexible the navigation system is. It’s crucial for building fluid, intuitive user experiences, and once you get the hang of it, it feels natural.
What I’d Change: Handling of UI Performance
One area where I’d like to see improvement in React Native is in its handling of complex UIs. While React Native does a great job at rendering most UI components, when dealing with large lists or complex animations, the app’s performance can sometimes suffer, especially on lower-end devices. To address this, I’ve learned to use libraries like React Native’s FlatList
component, which optimizes rendering large lists by only rendering items that are visible on screen. However, it’s still an area where I think React Native could improve out-of-the-box performance for highly dynamic UIs.
Most Difficult Learning Curve: React Navigation
As mentioned earlier, React Navigation had the most difficult learning curve for me. I spent a lot of time trying to understand how the different navigators worked together and how to pass data efficiently between screens. It was tricky getting things to work as expected, but now that I’ve got the hang of it, I can confidently build navigation flows and handle user input in a seamless manner. React Native’s official documentation was helpful here, but there was a lot to absorb in terms of configurations and best practices.
Easiest Technology: Expo for Development
One of the easiest technologies I’ve worked with in this stack is Expo. Expo is a framework and platform for React Native that provides a suite of tools to simplify development. It includes things like a development server, hot reloading, and easy access to native device functionality like the camera or location services. Expo made it incredibly easy to get up and running with React Native, and I was able to see my changes instantly without much configuration. For anyone just starting out with React Native, I highly recommend using Expo to quickly prototype and test your app.
If I Could Start Over: Alternative Technologies
If I had to start over, I might consider using Flutter instead of React Native. Flutter, developed by Google, also allows for cross-platform development but has a different approach to rendering UI elements. While React Native relies on native components, Flutter uses its own rendering engine, which can result in more consistent UIs across different platforms. That said, I’m happy with React Native for this project, and I’ve learned a lot by sticking with it.
Technology I Wish Was Included: TypeScript
One technology I wish I had included in my stack earlier is TypeScript. While React Native is perfectly functional with plain JavaScript, using TypeScript could have helped catch type-related bugs early in development. As the project grows in complexity, having strong typing would make the codebase more robust and easier to maintain. If I had the chance to add TypeScript from the start, I definitely would.