Platform

Detect what is the platform in which the app is running.

This piece of functionality can be useful when only small parts of a component are platform specific.

import { Platform } from 'react-native';

API

Static properties

OS "web"

This value will be "web" when running in a Web browser.

isTV boolean

Whether TV navigation mode is enabled. In this fork, this currently resolves to true to enable TV-first focus behavior on web runtimes.

Static methods

select (config) => any

Takes an object containing Platform.OS values as keys and returns the value for the platform you are currently running on.

Updated
React Native Web for TVPortions Copyright © Nicolas Gallagher, Meta Platforms, Inc., Facebook, Inc. and affiliates, and other contributors as noted in file headers and THIRD_PARTY_NOTICES.md. Modifications and TV extensions Copyright © Harpreet Singh and contributors.