Getting Started
Install React Native Boost to boost your app's performance with one line of code.
Introduction
React Native Boost consists of two pieces:
- A Babel plugin that statically analyzes your source code and replaces safe
TextandViewcomponents with their direct native counterparts, leading to significant performance improvements compared to the JS-based wrapper components. - A runtime package used internally by the plugin for cross-platform-safe imports and helper utilities.
The analyzer is intentionally strict and skips any optimizations that may lead to user-facing bugs and behavioral changes.
Compatibility
react-native-boost | React Native |
|---|---|
0.x | All versions1 |
1.x | >=0.83 |
Getting Started
- Install React Native Boost:
npm install react-native-boostpnpm add react-native-boostyarn add react-native-boostbun add react-native-boost- If you use Expo and do not have a
babel.config.jsyet:
npx expo customize babel.config.js- Add the plugin:
// babel.config.js
module.exports = {
plugins: ['react-native-boost/plugin'],
};If you're using Unistyles or Nativewind in your project, refer to these additional setup instructions:
- Restart the development server and clear cache:
npm start -- --clearpnpm start -- --clearyarn start --clearbun run start --clearRuntime Dependency
The Babel plugin imports optimized components via react-native-boost/runtime, so react-native-boost must be
available at runtime and must therefore not be installed as a dev dependency.
Platform Support
React Native Boost supports all platforms. Optimizations are performed on iOS and Android, while falling back to the default components on all other platforms.
Footnotes
-
Starting from React Native
0.80,react-native-boost@0prints import deprecation warnings. See react-native-community/discussions-and-proposals #893. ↩