Overview
What React Native Boost can optimize and the cases it safely skips.
React Native Boost includes different optimizers that optimize different parts of your app.
Native Text
Removes the React Native Text wrapper.
Native View
Removes the React Native View wrapper.
Native Image
Moves Image wrapper work to build time.
Native Activity Indicator
Builds the native spinner tree ahead of time.
Animated Value Initialization
Creates persistent Animated values only once.
Animated Wrapper Removal
Removes Animated wrappers that contain no animation.
StyleSheet Operations
Evaluates static StyleSheet operations during the build.
Platform Folding
Resolves static React Native platform branches.
Shared component safety rules
When optimizing a component, all optimizers first confirm that the component comes from react-native. A component from another package, or a local component with the same name, is not changed.
Boost also skips a component when:
- Its file matches an
ignorespattern. - Its line has
@boost-ignore. - Required information is only available at runtime.
Set logLevel: 'debug' to see why a component was skipped.
Controlling optimizers
Most optimizers are enabled by default. Exceptions are:
- The Animated Wrapper Removal optimizer is enabled by default only for React Native 0.83 through 0.86.
You can turn each optimizer on or off in metro.config.js:
module.exports = withBoostConfig(config, {
optimizations: {
'native-image': 'off',
'animated-wrapper-removal': 'on',
},
});See Configure Boost for all options.