Install
$ agentstack add skill-react-native-tvos-skills-platform-detection ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
About
TV Platform Detection
When to Use
- Detecting whether the app is running on a TV device
- Writing platform-specific code for TV vs. mobile
- Configuring Metro for TV-specific file extensions
- Branching logic based on Apple TV vs. Android TV
Platform API
import { Platform } from 'react-native';
// Detect any TV device (Apple TV or Android TV)
const isTV = Platform.isTV;
// Detect specifically Apple TV (tvOS), excluding Android TV
const isAppleTV = Platform.isTVOS;
TV-Specific File Extensions
The template-tv Metro configuration allows Metro to resolve TV-specific source files using special file extensions:
Resolution Order
When enabled, Metro resolves files in this order (example for .tsx):
file.ios.tv.tsxorfile.android.tv.tsxfile.tv.tsxfile.ios.tsxorfile.android.tsxfile.tsx
This works the same way for all standard extensions (.js, .ts, .jsx, etc.) as documented in Metro docs.
Setup
This config is not enabled by default since it impacts bundling performance. It is available for developers who need platform-specific TV code at the file level.
To enable it, see the Metro config example in the template-tv repository.
Common Patterns
Conditional Rendering
import { Platform, View, Text } from 'react-native';
const MyComponent = () => (
{Platform.isTV ? (
TV-optimized layout
) : (
Mobile layout
)}
);
Platform-Specific Styles
import { Platform, StyleSheet } from 'react-native';
const styles = StyleSheet.create({
container: {
padding: Platform.isTV ? 40 : 16,
fontSize: Platform.isTV ? 24 : 14,
},
});
Typescript
Typescript types for TV-specific components and APIs are available in types/public.
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: react-native-tvos
- Source: react-native-tvos/skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.