Loading...
Loading...
Expert in React Native (New Architecture), TurboModules, Fabric, and Expo. Specializes in native module development and performance optimization.
npx skill4agent add 404kidwiz/claude-supercode-skills react-native-specialistWhich architecture to use?
│
├─ **New Architecture (Default for 0.76+)**
│ ├─ **TurboModules:** Lazy-loaded native modules (Sync/Async).
│ ├─ **Fabric:** C++ Shadow Tree for UI (No bridge serialization).
│ ├─ **Codegen:** Type-safe spec for Native <-> JS communication.
│ └─ **Bridgeless Mode:** Removes the legacy bridge entirely.
│
└─ **Old Architecture (Legacy)**
├─ **Bridge:** Async JSON serialization (Slow for large data).
└─ **Maintenance:** Only for unmigrated legacy libraries.| Feature | Expo (Managed) | React Native CLI (Bare) |
|---|---|---|
| Setup | Instant ( | Complex (JDK, Xcode, Pods) |
| Native Code | Config Plugins (Auto-modifies native files) | Direct file editing ( |
| Upgrades | | Manual diffing (Upgrade Helper) |
| Builds | EAS Build (Cloud) | Local or CI (Fastlane) |
| Updates | EAS Update (OTA) | CodePush (Microsoft) |
mobile-developerNativeBattery.tsimport type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
getBatteryLevel(): number;
}
export default TurboModuleRegistry.getEnforcing<Spec>('RTNBattery');yarn codegenRTNBattery.mm- (NSNumber *)getBatteryLevel {
[UIDevice currentDevice].batteryMonitoringEnabled = YES;
return @([UIDevice currentDevice].batteryLevel);
}
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
(const facebook::react::ObjCTurboModule::InitParams &)params {
return std::make_shared<facebook::react::NativeBatterySpecJSI>(params);
}BatteryModule.ktclass BatteryModule(context: ReactApplicationContext) : NativeBatterySpec(context) {
override fun getName() = "RTNBattery"
override fun getBatteryLevel(): Double {
val manager = context.getSystemService(Context.BATTERY_SERVICE) as BatteryManager
return manager.getIntProperty(BatteryManager.BATTERY_PROPERTY_CAPACITY).toDouble()
}
}import { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
import { GestureDetector, Gesture } from 'react-native-gesture-handler';function Ball() {
const offset = useSharedValue({ x: 0, y: 0 });
const gesture = Gesture.Pan()
.onUpdate((e) => {
// Runs on UI thread
offset.value = { x: e.translationX, y: e.translationY };
})
.onEnd(() => {
offset.value = withSpring({ x: 0, y: 0 }); // Snap back
});
const style = useAnimatedStyle(() => ({
transform: [{ translateX: offset.value.x }, { translateY: offset.value.y }]
}));
return (
<GestureDetector gesture={gesture}>
<Animated.View style={[styles.ball, style]} />
</GestureDetector>
);
}Animated.timinguseNativeDriver: falseuseEffectsetStateuseNativeDriver: truepodfilebuild.gradlestyle={{ width: 100, height: 100 }}StyleSheet.createconst style = { ... }useMemouseCallbackFlashListFlatList