Skip to content
Back to skills

React Native Platform Specific

ASecurity

Resolve iOS and Android differences using Platform API and native modules in React Native. Use when handling platform-specific behavior or integrating native modules in React Native.

  • 549 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added June 6, 2026
developmentswiftkotlinreactapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned June 6, 2026

npx -y skills add HoangNguyen0403/agent-skills-standard --skill react-native-platform-specific --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of React Native Platform Specific?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for React Native Platform Specific
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/hoangnguyen0403-react-native-platform-specific/badge)](https://www.skillsdirectory.com/skills/hoangnguyen0403-react-native-platform-specific)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: react-native-platform-specific
description: Resolve iOS and Android differences using Platform API and native modules in React Native. Use when handling platform-specific behavior or integrating native modules in React Native.
metadata:
  triggers:
    files:
      - '**/*.tsx'
      - '**/*.ts'
      - '**/*.ios.*'
      - '**/*.android.*'
    keywords:
      - Platform
      - Platform.select
      - native-module
      - ios
      - android
---

# React Native Platform-Specific Code

## **Priority: P1 (OPERATIONAL)**

## Split Platform-Specific Files

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

See [native modules reference](references/native-modules.md) 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](references/native-modules.md) for Platform detection examples, Native Bridge (iOS/Android), Expo JSI Modules, and SafeArea handling.

Files in this skill

  • SKILL.md1.6 KB
  • evals/evals.json2.1 KB
  • references/native-modules.md2.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.