React Native Blog Jun 21, 2023

Metro Package Exports and Symlinks in React Native 0.72

Article Summary

React Native 0.72 just dropped with the two most requested Metro features that developers have been waiting years for. Monorepo teams and pnpm users, this one's for you.

The React Native team released version 0.72, prioritizing features directly from their 2022 community survey feedback. This release focuses heavily on Metro bundler improvements and developer experience enhancements that address long-standing pain points in the ecosystem.

Key Takeaways

Critical Insight

React Native 0.72 delivers community-driven Metro improvements that eliminate monorepo workarounds and modernize package resolution, with over 1100 commits from 66 contributors.

The new metro.config.js format becomes required in 0.73, and there's a specific reason the team is moving New Architecture updates to a separate channel.

About This Article

Problem

Metro's config loading required manual workarounds, and standalone Metro CLI commands like `metro get-dependencies` didn't work properly in React Native projects.

Solution

React Native 0.72 changed how metro.config.js works. Projects now control how they extend the base Metro config instead of relying on leftover defaults, which lets CLI commands function independently.

Impact

Developers can use standalone Metro CLI commands directly. React Native 0.72 includes a warning period for the format changes, which become required in 0.73 to give teams time to migrate.