인터페이스는 현지화되어 있으며, Skill 소개와 설명 문서는 선택한 언어로 AI가 자동 번역합니다. 코드·명령어·경로·전문 용어는 원문을 유지하며 원작자 문서가 우선합니다.
Skills 둘러보기
생산성 및 협업 · SKILL.md

react-native-platform-specific

react-native-platform-specific

Resolve iOS and Android differences using Platform API and native modules in React Native. Use when platform branching or native-module integration is the primary task; defer cross-platform feature implementation such as push notifications.

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill 문서

GitHub

name: react-native-platform-specific description: Resolve iOS and Android differences using Platform API and native modules in React Native. Use when platform branching or native-module integration is the primary task; defer cross-platform feature implementation such as push notifications. metadata: triggers: files: - '/*.tsx' - '/.ts' - '**/.ios.' - '**/.android.*' keywords: - Platform - Platform.select - native-module - ios - android

React Native Platform-Specific Code

Priority: P1 (HIGH)

Split Platform-Specific Files

Use .ios. and .android. for platform-specific files:

See native modules reference for platform-specific file naming, Platform.select usage, and native bridge examples.

React Native automatically picks right file:

  • iOS: Button.ios.tsx then Button.tsx (fallback)
  • Android: Button.android.tsx then Button.tsx (fallback)

Apply Platform Branching Inline

Use Platform.select or Platform.OS for small differences within shared file.

Integrate Native Modules

  • Expo: Use Expo modules when available (expo-* packages).
  • Bare RN: Use community modules (@react-native-community/*).
  • Custom: Write native modules in Swift/Kotlin when needed.

Anti-Patterns

  • No Excessive Branching: Extract to separate files if logic diverges significantly.
  • No Hardcoded Version Checks: Use feature detection.
  • No Ignoring Android: Test on both platforms.

References

See references/native-modules.md for Platform detection examples, Native Bridge (iOS/Android), Expo JSI Modules, and SafeArea handling.

저장한 Skills