React Native 0.72: A Major Release with New Features and Improvements

Amir Hosseini
5 min readJul 9, 2023

--

React Native 0.72 was released on June 21, 2023. It includes a number of new features and improvements, including:

  • TurboModules: TurboModules are a new way to write native modules for React Native. They are more efficient and easier to use than traditional native modules.
  • Runtime Linking support for iOS: Runtime Linking enables React Native apps to dynamically link to third-party libraries at runtime. This makes it easier to add new features to your app without having to rebuild the entire app.
  • Symlink support: Symlink support enables React Native to work transparently with monorepo setups and pnpm. This removes the need for workarounds.
  • Improved error handling: React Native 0.72 includes a number of improvements to error handling. This makes it easier to debug your apps and identify the source of errors.
  • New debugging tools: React Native 0.72 includes a number of new debugging tools, including a new debugger and a new performance profiler. These tools can help you to find and fix performance issues in your apps.

TurboModules

TurboModules are a new way to write native modules for React Native. They are more efficient and easier to use than traditional native modules. TurboModules are written in JavaScript, but they can call native code. They are also more modular than traditional native modules, which makes them easier to reuse.

To use TurboModules, you need to create a new file in your project called TurboModule.js. This file will contain the code for your TurboModule. You can then import your TurboModule into your React Native app.

Here is an example of a TurboModule:

As you can see, TurboModules are very similar to regular React Native components. They have a name property and they can export methods. The main difference is that TurboModules can call native code.

Runtime Linking support for iOS

Runtime Linking is a new feature in React Native 0.72 that enables React Native apps to dynamically link to third-party libraries at runtime. This makes it easier to add new features to your app without having to rebuild the entire app.

To use Runtime Linking, you need to add a new file to your project called app.json. This file will contain the list of third-party libraries that you want to link to.

Here is an example of an app.json file:

As you can see, the runtimeLinking property contains a list of libraries that you want to link to. You can get the list of libraries that you need from the third-party library's documentation.

Once you have added the app.json file, you can run the following command to link the libraries: “react-native link”

This command will download the libraries and link them to your app.

Symlink support

Symlink support is a new feature in React Native 0.72 that enables React Native to work transparently with monorepo setups and pnpm. This removes the need for workarounds.

To use Symlink support, you need to add a new file to your project called .gitignore. This file will contain a list of files that you do not want to track in your git repository.

Here is an example of a .gitignore file:

As you can see, the .gitignore file contains a list of files that you do not want to track in your git repository. This includes the node_modules directory, which contains all of the third-party libraries that your app depends on.

Once you have added the .gitignore file, you can run the following command to symlink the node_modules directory: “react-native link”

Improved error handling

React Native 0.72 includes a number of improvements to error handling. These improvements make it easier to debug your apps and identify the source of errors.

One of the most significant improvements is that React Native now provides more detailed error messages. This includes information about the line of code where the error occurred, the stack trace, and the type of error. This information can be very helpful in debugging your app.

Another improvement is that React Native now provides better support for asynchronous errors. Asynchronous errors are errors that occur in a different thread from the main thread. In the past, these errors could be difficult to debug. However, React Native 0.72 now provides a better way to handle asynchronous errors.

Finally, React Native 0.72 also includes a number of smaller improvements to error handling. These improvements include better error messages for specific types of errors, and better support for debugging errors in React Native modules.

New debugging tools

React Native 0.72 includes a number of new debugging tools, including a new debugger and a new performance profiler. These tools can help you to find and fix performance issues in your apps.

The new debugger is a more powerful and flexible debugger than the previous debugger. It provides a number of new features, including:

  • Breakpoint support: You can now set breakpoints in your code to stop the debugger at a specific line of code.
  • Variable inspection: You can now inspect the value of variables in your code.
  • Call stack inspection: You can now inspect the call stack to see how your code is executing.

The new performance profiler is a tool that can help you to identify performance bottlenecks in your app. It provides a number of metrics, including:

  • Frame rate: The frame rate is the number of frames that your app renders per second.
  • CPU usage: The CPU usage is the percentage of CPU time that your app is using.
  • Memory usage: The memory usage is the amount of memory that your app is using.

The performance profiler can help you to identify the parts of your app that are causing performance problems. This information can be used to improve the performance of your app.

Overall, React Native 0.72 includes a number of new features and improvements that can make it easier to develop and debug React Native apps. The new TurboModules, Runtime Linking support, Symlink support, improved error handling, and new debugging tools can all help you to build better React Native apps.

--

--