Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@wouterds/react-native-tv-focus

wouterds59MIT1.0.5TypeScript support: included

test

react-native, ios, android, tv, tvos, androidtv, focus, tv-focus

readme

@wouterds/react-native-tv-focus

A package to programatically focus views on tvOS & AndroidTV.

Installation

# yarn
yarn add @wouterds/react-native-tv-focus

# npm
npm install @wouterds/react-native-tv-focus

Usage

import { findNodeHandle } from 'react-native';
import { focus } from '@wouterds/react-native-tv-focus';

// ...

// get tag by ref from a UI element
const tag = findNodeHandle(ref.current);

// programatically force focus on tag
focus(tag);