This package provides a fork of React Native specifically adapted for developing applications on TV platforms, including Apple TV (tvOS) and Android TV. It extends the core React Native framework with TV-specific navigation primitives, focus management, and input handling necessary for an optimal 10-foot user experience. The current stable version, `0.85.0-0`, aligns closely with mainstream React Native releases (e.g., React Native 0.85.x) but maintains its own maintenance cycle to integrate TV-specific features and fixes. Development appears active, with frequent updates tracking React Native's primary release train, evidenced by recent `0.85.0-0` release candidates and the final `0.85.0-0` release following `0.84.x` and `0.83.x`. Its key differentiators lie in its specialized focus engine, robust remote control input integration, and UI component adaptations for large screen environments, making it the primary choice for building native TV applications with React.
npm install react-native-tvosVerified import paths — ran on the pinned version, not inferred.
Demonstrates a basic React Native for TV application with focusable elements, remote control input handling using `TVEventHandler`, and dynamic style changes based on focus state. This provides a foundational example for building interactive TV user interfaces.
Review affected components. If possible, upgrade to a patched version once available, or implement custom logic to prevent interaction for disabled elements.
Ensure your Node.js version matches the specified engine requirements (`^20.19.4 || ^22.13.0 || ^24.3.0 || >= 25.0.0`). Use `nvm` or a similar tool to manage Node.js versions.
Utilize `focusable`, `nextFocusDown`, `nextFocusUp`, etc., props and ensure all interactive elements are properly focusable. Test extensively with a remote control simulator or physical device. Consider `TVFocusGuideView` for complex layouts.
Prioritize `react-native-tvos` components and modules. For third-party libraries, verify TV compatibility or implement wrappers to adapt them for TV input and focus paradigms.
Consult the official `react-native-tvos` documentation and upgrade to recent versions to leverage improved input handling and focus management systems. Refactor legacy `TVEventHandler` implementations if necessary, possibly using the `useTVEventHandler` hook.
Always review the upgrade guide for both `react-native-tvos` and the corresponding upstream React Native version. Expect manual intervention for native project files (e.g., `Podfile`, `build.gradle`). Use `npx react-native upgrade` as a starting point but be prepared for conflicts.
Use `npx react-native run-ios --scheme <YourApp>-tvOS --destination 'platform=tvOS Simulator,name=Apple TV'` or similar. Ensure your Xcode project has a tvOS scheme configured and that `react-native-tvos` is properly integrated.
For iOS/tvOS, navigate to the `ios` directory and run `pod install`. For Android, run `gradlew clean` and rebuild the project. Confirm that `react-native-tvos` native modules are correctly linked and that autolinking is working.
Add or update your `package.json` to include `"resolutions": { "react-native": "npm:react-native-tvos@latest" }` (for Yarn) or `"overrides": { "react-native": "npm:react-native-tvos@latest" }` (for npm 8+) to alias the package properly. Then, reinstall dependencies (`yarn install` or `npm install`).Ensure you have `import React from 'react';` at the top of your `.tsx` or `.jsx` files and that `@types/react` is installed as a dev dependency (`npm install --save-dev @types/react`).
This is a regression in specific versions. Consider upgrading to a patched version if available. Workarounds might involve manually managing focus state or using `TVFocusGuideView` to explicitly guide focus.