React Native 0.74: What is new? and What does that mean?

5/8/20243 min read

Introduction

The Latest Version of React Native 0.74 was released on the 22 of April, you can read more about it here in this official documentation. I wanted to talk about it, but waited until I tested it personally, and confirmed the amazing work that has been done by the React Native team and community.

In this guide, I will talk about bullet points of what is new in this version, but at first, we start as always by giving an introduction of the Technical terms that are used in this guide, so you can understand it, and take your engineering skills to the next level

let’s start:

Terms and Definition:

Yoga in React Native:

Yoga is a layout engine written in C++ that is used by React Native to determine the positioning of elements on the screen. It takes your layout instructions (flexbox, etc.) and calculates the exact coordinates for each element.

Term explication: Imagine you have a button and a text element in your React Native app. Yoga acts like a ruler and measuring tape, using your flexbox properties (like flex: 1) to determine how much space each element should take and how they should be positioned relative to each other. This ensures your app's UI looks as intended on different devices.

Bridgeless Architecture:

Bridgeless architecture is a new approach in React Native 0.74 that removes the communication layer (bridge) between JavaScript and native code in specific scenarios. This bridge is normally used to pass data between the two environments. Bridgeless mode allows for more direct communication, improving performance.

Term explication: Think of your React Native app as an island (JavaScript code) and the native platform (Android or iOS) as the mainland. Normally, data needs to be sent over a bridge to interact. Bridgeless architecture is like having a boat directly connecting the island and the mainland for faster communication in certain situations. This improves the performance of specific tasks that don’t require the full bridge functionality.

Yarn:

Yarn is a package manager specifically designed for managing dependencies (libraries) in JavaScript projects. It helps you install, update, and remove these libraries efficiently. React Native projects rely on various libraries to function. Yarn helps keep track of these and ensures you have the correct versions.

Android SDK:

The Android SDK (Software Development Kit) is a collection of tools and resources provided by Google for building Android apps. It includes essential components like libraries, tools (compilers, debuggers), and documentation to help developers write and test their apps.

What is new in React Native 0.74:

1- Improved Layout Engine (Yoga 3.0):

The new version of the Yoga layout engine enhances the predictability of styling, ensuring that layout behaviors are more consistent across different devices and screen sizes.

It also offers better support for web components, making it easier to share styling logic between React Native and web projects, improving code reusability and maintainability.

2- Bridgeless by Default (New Architecture):

The new architecture prioritizes Bridgeless Mode, which eliminates the traditional bridge between JavaScript and native code.

This change significantly boosts performance by reducing the overhead associated with the bridge, leading to faster execution and smoother animations.

It also simplifies the communication between the JavaScript and native layers, reducing the potential for bugs and improving overall app stability.

3- Batched onLayoutUpdates (New Architecture):

The introduction of batched onLayout updates optimize performance by grouping multiple onLayout callbacks into a single batch.

This reduces the number of layout calculations and re-renders required, leading to more efficient rendering and smoother user interfaces.

Developers will notice improved performance in complex layouts and a reduction in CPU usage during layout changes.

4- Yarn 3 as Default Package Manager:

React Native 0.74 now uses Yarn 3 by default for new projects, replacing Yarn Classic.

Yarn 3 offers faster package installation, improved dependency resolution, and better support for modern JavaScript features.

This change streamlines the development workflow and ensures that projects benefit from the latest advancements in package management.

Breaking Changes:

1- PropTypes Removal:

PropTypes have been removed from the core React Native package to reduce bundle size and improve performance.

Developers will need to implement their own type-checking solutions, such as using TypeScript or importing the prop-types package separately.

2- PushNotificationIOS Changes:

The PushNotificationIOS API has undergone significant changes, making it more modular and paving the way for a community-driven approach.

Developers will need to update their code to align with the new API structure and should refer to the updated documentation for guidance.

3- Minimum Android SDK Bump:

The minimum required Android version for React Native projects is now Android 6.0 (SDK 23).

This change potentially improves performance and reduces app size by allowing the use of newer Android features and deprecating support for older, less efficient APIs.

Developers targeting older Android versions will need to update their project configurations and test their apps on supported devices.

Conclusion

These are the latest changes in React Native 0.74. It is a highly recommended version from my personal point of view. You can check more details about the changes in the official documentation.

if you need upgrade to the latest version of your React native version, check the link here: https://casainnov.com/mobiledevelopment