React Native Boost

Configure the Babel Plugin

Control logging, ignores, and optimization behavior.

The Babel plugin (react-native-boost/plugin) is the core of React Native Boost.

Defaults are safe and usable out of the box, but you can tune behavior for your app.

Example Configuration

// babel.config.js
module.exports = {
  plugins: [
    [
      'react-native-boost/plugin',
      {
        verbose: false,
        silent: false,
        ignores: ['node_modules/**'],
        optimizations: {
          text: true,
          view: true,
        },
      },
    ],
  ],
};

Plugin Options

ignores

Paths to ignore from optimization.

Patterns are resolved from Babel's current working directory. In nested monorepo apps, parent segments may be needed, for example ../../node_modules/**.

  • Type: string[] | undefined
  • Default: []

verbose

Enables verbose logging.

With silent: false, optimized components are logged by default. When enabled, skipped components and their skip reasons are also logged.

  • Type: boolean | undefined
  • Default: false

silent

Disables all plugin logs.

When set to true, this overrides verbose.

  • Type: boolean | undefined
  • Default: false

optimizations

Toggle individual optimizers.

If omitted, all available optimizers are enabled.

  • Type: PluginOptimizationOptions | undefined

dangerouslyOptimizeViewWithUnknownAncestors

Opt-in flag that allows View optimization when ancestor components cannot be statically resolved.

This increases optimization coverage, but may introduce behavioral differences when unresolved ancestors render React Native Text wrappers. Prefer targeted ignores first, and enable this only after verifying affected screens.

  • Type: boolean | undefined
  • Default: false

Plugin Optimization Options

text

Whether to optimize the Text component.

  • Type: boolean | undefined
  • Default: true

view

Whether to optimize the View component.

  • Type: boolean | undefined
  • Default: true

Environment-Specific Enablement

You can enable React Native Boost by environment with Babel env config:

module.exports = {
  env: {
    development: {
      plugins: ['react-native-boost/plugin'],
    },
  },
};

See Babel docs: https://babeljs.io/docs/options#env

On this page