react-native-specialist by 404kidwiz/claude-supercode-skills
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill react-native-specialist提供 React Native 开发专业知识,专注于"新架构"(Fabric/TurboModules)、JSI 和 Expo 工作流。使用自定义原生模块和优化的 JavaScript 到原生桥接构建高性能跨平台移动应用程序。
场景: 将大型生产应用从 Bridge 迁移到 Fabric/TurboModules。
实施:
结果:
场景: 需要为健身应用集成蓝牙低功耗。
实施:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
场景: 应用出现卡顿滚动和内存问题。
实施:
结果:
Which 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.
| 功能 | Expo(托管) | React Native CLI(原生) |
|---|---|---|
| 设置 | 即时(create-expo-app) | 复杂(JDK、Xcode、Pods) |
| 原生代码 | Config Plugins(自动修改原生文件) | 直接文件编辑(AppDelegate.m) |
| 升级 | npx expo install --fix(稳定集) | 手动比对(Upgrade Helper) |
| 构建 | EAS Build(云端) | 本地或 CI(Fastlane) |
| 更新 | EAS Update(OTA) | CodePush(Microsoft) |
危险信号 → 升级到 mobile-developer(原生):
目标: 通过 JSI 同步访问原生电池电量。
步骤:
定义规范(NativeBattery.ts)
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
getBatteryLevel(): number;
}
export default TurboModuleRegistry.getEnforcing<Spec>('RTNBattery');
生成代码
yarn codegen。生成 C++ 接口。实现 iOS(RTNBattery.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);
}
实现 Android(BatteryModule.kt)
class 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()
}
}
目标: 在 UI 线程上实现 60fps 的拖拽手势。
步骤:
设置
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.timing 并设置 useNativeDriver: false。useEffect 和 setState 中计算布局。失败原因:
正确方法:
useNativeDriver: true。表现:
失败原因:
正确方法:
podfile / build.gradle 中启用 Hermes(新 Expo 项目中默认启用)。表现:
style={{ width: 100, height: 100 }}失败原因:
正确方法:
StyleSheet.create 或 const style = { ... }。性能:
useMemo/useCallback。FlashList 而不是 FlatList。架构:
原生:
每周安装量
75
仓库
GitHub 星标数
45
首次出现
2026年1月24日
安全审计
安装于
opencode60
gemini-cli57
codex55
claude-code54
cursor49
github-copilot48
Provides React Native development expertise specializing in the "New Architecture" (Fabric/TurboModules), JSI, and Expo workflows. Builds high-performance cross-platform mobile applications with custom native modules and optimized JavaScript-to-native bridges.
Scenario: Migrating a large production app from Bridge to Fabric/TurboModules.
Implementation:
Results:
Scenario: Need to integrate Bluetooth Low Energy for a fitness app.
Implementation:
Results:
Scenario: App experiencing janky scrolling and memory issues.
Implementation:
Results:
Which 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 (create-expo-app) | Complex (JDK, Xcode, Pods) |
| Native Code | Config Plugins (Auto-modifies native files) | Direct file editing (AppDelegate.m) |
| Upgrades | npx expo install --fix (Stable sets) | Manual diffing (Upgrade Helper) |
| Builds | EAS Build (Cloud) | Local or CI (Fastlane) |
| Updates | (OTA) |
Red Flags → Escalate tomobile-developer (Native):
Goal: Access native battery level synchronously via JSI.
Steps:
Define Spec (NativeBattery.ts)
import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';
export interface Spec extends TurboModule {
getBatteryLevel(): number;
}
export default TurboModuleRegistry.getEnforcing<Spec>('RTNBattery');
Generate Code
yarn codegen. Generates C++ interfaces.Implement iOS (RTNBattery.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);
}
Goal: 60fps drag gesture on the UI thread.
Steps:
Setup
import { useSharedValue, useAnimatedStyle, withSpring } from 'react-native-reanimated';
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
Implementation
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>
);
}
What it looks like:
Animated.timing with useNativeDriver: false.useEffect and setState.Why it fails:
Correct approach:
useNativeDriver: true.What it looks like:
Why it fails:
Correct approach:
podfile / build.gradle (Default in new Expo).What it looks like:
style={{ width: 100, height: 100 }}Why it fails:
Correct approach:
StyleSheet.create or const style = { ... } outside component.Performance:
useMemo/useCallback used for expensive props.FlashList used instead of FlatList.Architecture:
Native:
Weekly Installs
75
Repository
GitHub Stars
45
First Seen
Jan 24, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode60
gemini-cli57
codex55
claude-code54
cursor49
github-copilot48
GSAP 框架集成指南:Vue、Svelte 等框架中 GSAP 动画最佳实践
3,200 周安装
Power BI 语义建模最佳实践指南:星型模式、DAX 度量值与模型优化
8,100 周安装
AI 自动生成编码规范 | 基于项目文件智能创建代码风格指南
8,100 周安装
ScoutQA AI驱动Web应用探索性测试工具 - 自动化测试与验证解决方案
8,100 周安装
PlantUML ASCII 图表生成器 - 命令行文本图表工具,支持序列图、类图、活动图
8,200 周安装
pytest-coverage:Python测试覆盖率工具,一键生成代码覆盖率报告
8,300 周安装
Markdown转HTML专业技能 - 使用marked.js、Pandoc和Hugo实现高效文档转换
8,200 周安装
| CodePush (Microsoft) |
Implement Android (BatteryModule.kt)
class 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()
}
}