@hozo/rn-compat
v0.4.0
Published
Optional React Native compatibility APIs for incrementally migrating applications to Hozo.
Maintainers
Readme
@hozo/rn-compat
Optional compatibility APIs for migrating existing React Native applications without retaining React Native Web for the supported surface.
import { Dimensions, Modal, Platform, StyleSheet } from '@hozo/rn-compat'On React Native, package conditions select the platform APIs. On the Web, Hozo supplies focused
DOM implementations. This is not a complete React Native namespace: canonical components such as
View, Text, Pressable, Image, TextInput, ScrollView, and FlatList belong to
@hozo/primitives (or the @hozo/core facade).
The Animated surface intentionally contains only Animated.View. Animation graphs, drivers,
timing, interpolation, and events remain outside this compatibility package.
Supported surface
Modal,ActivityIndicator,TouchableOpacity, andTouchableWithoutFeedback- the narrow
Animated.Viewadapter Platform,Dimensions,Keyboard,AccessibilityInfo, andStyleSheetPanResponder,useColorScheme, anduseWindowDimensions
Importing from @hozo/rn-compat works under any configuration. The compiler moves these imports
out of existing react-native source for you only when the build sets unloweredReactNativeJsx
to 'warn' or 'error'; the rewritten imports then land in your source, so the application needs
@hozo/rn-compat in its own dependencies, and Hozo warns (RN_COMPAT_NOT_INSTALLED) when it cannot
resolve it. On Native, the package's react-native export condition reaches React Native's
implementations directly.
Part of Hozo, a universal UI framework for React Native, compiled by Rust, with native semantics on every platform, first-class accessibility, and diagnostics for humans and AI agents alike. Most applications install @hozo/core and one build integration; see Getting started. Source and issues: github.com/iray-tno/hozo.
