React Native Boost

Runtime Library

Runtime exports used by the Babel plugin and advanced integrations.

react-native-boost/runtime is used by the Babel plugin to apply optimizations safely across platforms.

Besides re-exporting optimized native components with web-safe fallbacks, it also exposes helper utilities.

Direct usage is supported but generally not recommended unless needed for advanced integrations (for example, Nativewind setup).

API Reference

This section is automatically generated from runtime exports.

Functions

processTextStyle

Normalizes Text style values for NativeText.

  • Type: (style: GenericStyleProp<TextStyle>) => Partial<TextProps>

Parameters

  • style: GenericStyleProp<TextStyle> - Style prop passed to a text-like component.

Returns

Partial<TextProps>: Native-friendly text props. Returns an empty object when style is falsy or cannot be normalized.

Notes

- Flattens style arrays via StyleSheet.flatten - Converts numeric fontWeight values to string values - Maps userSelect and verticalAlign to native-compatible props

processAccessibilityProps

Normalizes accessibility and ARIA props for runtime native components, mirroring the reconciliation Text performs before handing off to its native host.

  • Type: (props: Record<string, any>) => Record<string, any>

Parameters

  • props: Record<string, any> - Accessibility and ARIA props.

Returns

Record<string, any>: Props with normalized accessibility fields.

Notes

- Merges aria-label with accessibilityLabel * - Merges ARIA state fields into accessibilityState * - Reconciles disabled with accessibilityState.disabled (the explicit disabled prop wins) * - Resolves the platform-specific accessible default (see {@link getDefaultTextAccessible})

Components

NativeText

Native Text component with graceful fallback.

  • Type: ComponentType<TextProps>

Notes

Uses unstable_NativeText on supported native runtimes and falls back to Text on web or when the unstable export is unavailable.

NativeView

Native View component with graceful fallback.

  • Type: ComponentType<ViewProps>

Notes

Uses unstable_NativeView on supported native runtimes and falls back to View on web or when the unstable export is unavailable.

Constants

getDefaultTextAccessible

The default value Text resolves for accessible when the prop is omitted: true on iOS (text is an accessibility element unless opted out), false on Android, and undefined elsewhere.

  • Type: () => boolean | undefined

Notes

Runtime fallback for the common optimized <Text> path (no accessibility props) when the target platform is unknown at build time. When it is known (Metro reports it on the Babel caller), the plugin inlines the literal instead and this is not emitted. Evaluated per render — like Text's own Platform.select — rather than hoisted to a constant, so it always reflects the current platform.

userSelectToSelectableMap

Maps CSS-like userSelect values to React Native's selectable prop.

  • Type: { auto: boolean; text: boolean; none: boolean; contain: boolean; all: boolean; }

verticalAlignToTextAlignVerticalMap

Maps CSS-like verticalAlign values to React Native's textAlignVertical.

  • Type: { auto: string; top: string; bottom: string; middle: string; }

Types

GenericStyleProp

Recursive style prop shape accepted by runtime style helpers.

  • Type: null | void | T | false | '' | ReadonlyArray<GenericStyleProp<T>>

Additional Tags

  • @template: - Style object type.

On this page