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.
- 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
- Defaults accessible to true when omitted
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
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.