Iván

React Native

開發程式設計v1.0.0
作者:Iván更新於 2026-05-11react-native@clawhub_ivangdavila/react-native
程式碼生成前端開發

據 AlphaMoat 統計,截至 2026-09,React Native 累計下載 4,544 次、獲 4 個星標,在全部 5,078 個 AI 技能中排名第 2,110 位,在「開發程式設計」分類(577 個)中排名第 269 位。

累計安裝
122
累計下載
4544
星標
4
全站排名
#2,110
全站前 42% · 「開發程式設計」前 47%
平台累計安裝累計下載星標評論
ClawHub ↗12245444-
SkillHub ↗11843014—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

主文建議長列表使用虛擬化方案,保持穩定的列表鍵,並按需要組織狀態與樣式;也涉及 Expo 專案導航及平台差異。執行未固定版本的 npx 命令或清理構建檔案前,應核對依賴版本、當前專案和目標目錄。

資料釋出於 2026-10-29

可以用來做什麼

  • 檢查 React Native 長列表的渲染方式
  • 規劃元件狀態、導航或樣式結構
  • 審查專案清理命令和構建目錄

什麼時候用

  • 需要設計或審查 React Native 應用實現,並能先核對依賴版本與專案路徑時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

根據一個列表場景比較虛擬列表與一次性渲染的適用性,不執行命令。
執行清理命令前,列出要確認的專案路徑、工作區狀態和平台目錄。

月度資料趨勢

累計下載4544
1990336247332026-03 · 累計下載 21792026-05 · 累計下載 32402026-06 · 累計下載 34892026-07 · 累計下載 39452026-08 · 累計下載 43282026-09 · 累計下載 454426-0326-09
星標4
3452026-03 · 星標 42026-05 · 星標 42026-06 · 星標 42026-07 · 星標 42026-08 · 星標 42026-09 · 星標 426-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-094544—4
2026-084328+9.7%4
2026-073945+13.1%4
2026-063489+7.7%4
2026-053240—4
2026-032179—4

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

4.7 KB · ClawHub v1.0.0
---
name: React Native
description: Build performant cross-platform mobile apps with React Native components, navigation, and native modules.
metadata: {"clawdbot":{"emoji":"📱","requires":{"anyBins":["npx","expo"]},"os":["linux","darwin","win32"]}}
---

# React Native Development Rules

## Component Performance
- `FlatList` for any list over 10 items — `ScrollView` with `map` loads everything in memory, FlatList virtualizes
展開全部(共 77 行)
- `keyExtractor` must return stable unique strings — using index causes bugs on reorder and deletion
- `React.memo` prevents re-renders when props unchanged — wrap pure display components
- `useCallback` for functions passed to child components — new function reference triggers child re-render
- Avoid inline styles in render — creates new object every render, extract to `StyleSheet.create`

## State Management
- `useState` is fine for component-local state — don't add Redux/Zustand for a toggle
- Lift state to lowest common ancestor only — higher causes unnecessary re-renders
- `useMemo` for expensive computations — but don't overuse, caching has overhead
- Context re-renders all consumers on any change — split contexts by update frequency
- Avoid storing derived data in state — compute during render from source state

## Navigation
- React Navigation is the standard — Expo Router for file-based routing in Expo projects
- Stack screens stay mounted by default — clean up subscriptions and timers in `useEffect` cleanup
- Pass serializable params only — functions and complex objects break deep linking and state persistence
- `useFocusEffect` for screen-specific side effects — runs on focus, not just mount
- `navigation.reset` for auth flows — clears back stack, prevents returning to login after sign-in

## Styling
- `StyleSheet.create` outside component body — creates styles once, not every render
- Flexbox defaults differ from web — `flexDirection: 'column'`, no `display: flex` needed
- Dimensions in density-independent pixels — don't use pixel values from design tools directly
- `Platform.select` for platform-specific styles — cleaner than conditionals in style objects
- No CSS inheritance — text styles don't cascade, each Text needs explicit styling

## Native Modules
- Expo modules cover most needs — avoid ejecting for common features like camera, location, notifications
- `expo-dev-client` enables native modules without full eject — best of both worlds
- React Native New Architecture (Fabric, TurboModules) is opt-in — check library compatibility before enabling
- Native crashes don't show in JS debugger — check Xcode/Android Studio logs

## Performance Debugging
- Hermes engine should be enabled — significantly faster startup and lower memory
- `InteractionManager.runAfterInteractions` defers heavy work — keeps animations smooth
- `useNativeDriver: true` for animations — runs on UI thread, not JS thread
- `console.log` in production kills performance — remove or use `__DEV__` guard
- Flipper for debugging — network, layout, performance profiling

## Images
- Use `resizeMode` appropriately — `cover` crops, `contain` letterboxes, `stretch` distorts
- Prefetch images for smooth UX: `Image.prefetch(url)` before displaying
- Local images need explicit dimensions — remote images can use aspect ratio if one dimension set
- SVGs via `react-native-svg` — better scaling than PNGs for icons
- Cache remote images with `react-native-fast-image` — default Image has no persistent cache

## Common Mistakes
- `async` in `useEffect` directly — must define async function inside, then call it
- Missing `key` warnings in lists — always use unique, stable keys
- Assuming web React patterns work — no DOM, no CSS, different event system
- Forgetting cleanup in `useEffect` — subscriptions, timers, listeners leak without cleanup return
- Testing only on one platform — iOS and Android differ in behavior, test both regularly

## Platform Differences
- Android needs explicit `overflow: 'hidden'` for border radius clipping — iOS clips by default
- Shadows: iOS uses `shadow*` props, Android uses `elevation`
- StatusBar behavior differs — test visibility and color on both platforms
- Back button is Android-only — handle with `BackHandler` or navigation listeners
- Push notifications setup differs significantly — platform-specific configuration required

## Build & Release
- `npx react-native clean` for unexplained build failures — clears caches and derived data
- iOS: `cd ios && pod install` after adding native dependencies — often forgotten step
- Android: `cd android && ./gradlew clean` for stubborn build issues
- EAS Build (Expo) simplifies CI/CD — handles signing, versioning, submission
- Test release builds locally before submitting — development and production behavior differ

「開發程式設計」分類下的熱門技能

Iván 的其他技能

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。