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 by the plugin for cross-platform-safe imports and helper utilities.
The analyzer is intentionally strict and skips any optimizations that could lead to behavioral changes or other bugs.
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'],
};- 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 can therefore not be installed as a dev dependency.
Platform Support
React Native Boost supports iOS and Android projects. On Web, React Native Boost safely falls back to the default components, providing full cross-platform support.