-
Notifications
You must be signed in to change notification settings - Fork 2
Description
Summary
dart_node_react_native wraps only 11 of 50+ React Native core components. Missing components include animations, keyboard handling, modals, platform detection, and styling — features required by every production mobile app. The npmComponent() escape hatch works but removes the type safety that is the entire point of the package.
What exists today (11 components)
| Component | Status |
|---|---|
View |
Typed wrapper |
Text |
Typed wrapper |
TextInput |
Typed wrapper |
TouchableOpacity |
Typed wrapper |
Button |
Typed wrapper |
ScrollView |
Typed wrapper |
SafeAreaView |
Typed wrapper |
ActivityIndicator |
Typed wrapper |
FlatList |
Typed wrapper |
Image |
Typed wrapper |
Switch |
Typed wrapper |
Plus: AppRegistry, typed NavigationProp/RouteProp, npmComponent()/npmComponentSafe(), Paper UI wrappers.
What's missing — grouped by priority
P0: Apps look/feel broken without these
Animations — Animated + LayoutAnimation
Animated.View,Animated.Text,Animated.Image,Animated.ScrollViewAnimated.timing(),Animated.spring(),Animated.decay()Animated.parallel(),Animated.sequence(),Animated.stagger()Animated.Value,Animated.ValueXYLayoutAnimation.configureNext()useAnimatedValuehook (from Reanimated if wrapping that too)
Impact: A mobile app without animations looks broken. Every production RN app uses animations for transitions, loading states, list insertions, and micro-interactions. This is the single biggest gap.
KeyboardAvoidingView
Impact: On iOS, any screen with a TextInput will have the keyboard cover the input field. This is a day-one bug for any form-based app. Every app with a login screen, registration form, or chat input needs this.
Modal
Impact: Cannot show confirmation dialogs, bottom sheets, date pickers, or any overlay UI without falling back to untyped npmComponent().
Alert
Alert.alert(title, message, buttons)
Impact: Cannot show native alert/confirmation dialogs. Standard UX for destructive actions (delete account, logout, etc.).
P1: Needed for real-world mobile apps
Pressable
The modern replacement for TouchableOpacity (recommended since RN 0.63). Supports pressed/focused/hovered states.
StatusBar
- Show/hide, light/dark content, background color, translucent
Impact: Cannot control status bar appearance. Apps look unprofessional with default status bar.
Platform
Platform.OS—'ios'or'android'Platform.Version— OS version numberPlatform.select({ios: ..., android: ...})
Impact: Cannot write platform-specific code. iOS and Android have different conventions (back button, status bar, safe areas, fonts).
Dimensions
Dimensions.get('window')/Dimensions.get('screen')useWindowDimensions()hook
Impact: Cannot get screen dimensions for responsive layouts.
StyleSheet
StyleSheet.create(styles)— validates and optimizes stylesStyleSheet.flatten()— merge style arraysStyleSheet.absoluteFill/StyleSheet.hairlineWidth
Impact: Must use raw JS objects for every style. No validation, no optimization, no IDE support.
RefreshControl
Impact: No pull-to-refresh on lists. Standard mobile UX pattern.
SectionList
Impact: No sectioned list support (contacts, settings screens, grouped data).
P2: Important for specific use cases
Linking— open URLs, deep links, handle incoming URLsBackHandler(Android) — handle hardware back buttonShare— native share sheetClipboard— read/write clipboardVibration/ hapticsPermissionsAndroid— request runtime permissionsAppearance— dark mode detection,useColorScheme()hookAppState— foreground/background detectionAccessibilityInfo— screen reader detectionVirtualizedList— custom virtualized list base class
Navigation gap
NavigationProp and RouteProp provide type-safe access to navigation state — this is well done. BUT:
You cannot define navigation structure from Dart. There are no wrappers for:
createStackNavigator()/Stack.Navigator/Stack.ScreencreateBottomTabNavigator()/Tab.Navigator/Tab.ScreencreateDrawerNavigator()/Drawer.Navigator/Drawer.ScreenNavigationContainer
The examples/mobile/ app defines its navigation structure in JavaScript and only uses Dart for screen components. A fully-Dart RN app is not possible without these.
Test gaps
Files: packages/dart_node_react_native/test/
The component tests only verify existence, not behavior:
test('view function exists', () {
expect(view, isA<Function>());
});
test('text function exists', () {
expect(text, isA<Function>());
});These pass even if the functions produce completely wrong output. The component factory functions are never actually CALLED in these tests.
What IS properly tested:
NavigationPropmethods — tested with mock JS objects, verifying actual callsRoutePropaccessors — tested with mock JS objectsextractScreenPropsedge cases- npm module loading/caching
- TestNode tree traversal and querying
What has zero behavioral tests:
- All 11 component wrappers (view, text, textInput, etc.)
- Component prop passing
- Event handler binding
- Style application
Suggested implementation order
KeyboardAvoidingView— fixes broken forms, small API surfaceModal+Alert— unlocks standard mobile UX patternsPlatform+Dimensions+StyleSheet— foundational APIs used everywherePressable— modern replacement for TouchableOpacityStatusBar— small API, big visual impact- Navigation structure (
createStackNavigator,NavigationContainer) — enables fully-Dart apps Animated— largest API surface, biggest impact on app quality- Component behavioral tests — actually call the factory functions and verify output
Files to modify
packages/dart_node_react_native/lib/src/components.dart— add new component wrapperspackages/dart_node_react_native/lib/src/— add new files:animated.dart,platform.dart,stylesheet.dart,navigation_structure.dartpackages/dart_node_react_native/lib/dart_node_react_native.dart— export new modulespackages/dart_node_react_native/test/— add behavioral tests for all components