react-native-tvfocus
Version:
React Native tvOS and Android TV library to improve focus management with multiple screens.
21 lines (20 loc) • 927 B
TypeScript
import React = require('react');
import { NativeSyntheticEvent, TargetedEvent, TVParallaxProperties } from 'react-native';
import FocusManager, { FocusManagerContext } from './focus-manager';
export interface FocusableProps {
hasTVPreferredFocus?: boolean;
isTVSelectable?: boolean;
tvParallaxProperties?: TVParallaxProperties;
onFocus?: (event: NativeSyntheticEvent<TargetedEvent>) => void;
onBlur?: (event: NativeSyntheticEvent<TargetedEvent>) => void;
}
export default class Focusable<P extends FocusableProps = FocusableProps> extends React.Component<P> {
context: React.ContextType<typeof FocusManagerContext>;
static contextType: React.Context<import("./focus-manager").FocusManagerContextValue>;
readonly id: number;
focus: FocusManager | null;
componentDidMount(): void;
componentDidUpdate(): void;
componentWillUnmount(): void;
onFocus: FocusableProps['onFocus'];
}