React Native Boost

Decorators

Control individual optimizations with @boost-ignore and @boost-force.

@boost-ignore

Use @boost-ignore to disable a specific optimization.

Place it immediately before a supported component or operation.

<Text>This will be optimized.</Text>
{/* @boost-ignore */}
<Text>This will not be optimized.</Text>

@boost-force

Use @boost-force to override bailout rules on a specific component or operation, such as an unknown ancestor, unresolved spread, or runtime style value.

It cannot enable a disabled optimizer, include a file excluded by ignores, or optimize a component that is not imported from react-native. It also cannot run a platform-specific optimizer when Boost cannot tell whether the build targets iOS or Android.

const Component = ({ props }) => {
  return (
    <>
      {/* @boost-force */}
      <Text {...props}>This will be optimized despite having unresolvable spread props.</Text>
    </>
  );
};

/* @boost-force */
const style = StyleSheet.flatten(styles);

Use with caution

@boost-force can bypass safety checks that prevent behavioral changes. Only use it when you have verified that the optimization is safe.

On this page