Skip to main content

tools-react-native

@rnx-kit/tools-react-native is a collection of supplemental react-native functions and types.

You can import the entire package, or, to save space, import individual categories:

import * from "@rnx-kit/tools-react-native";

import * from "@rnx-kit/tools-react-native/platform";
CategoryType NameDescription
platformAllPlatformsList of supported react-native platforms.
CategoryFunctionDescription
platformexpandPlatformExtensions(platform, extensions)Returns a list of extensions that should be tried for the target platform in prioritized order.
platformgetAvailablePlatforms(startDir)Returns a map of available React Native platforms. The result is cached.
platformgetAvailablePlatformsUncached(startDir, platformMap)Returns a map of available React Native platforms. The result is NOT cached.
platformparsePlatform(val)Parse a string to ensure it maps to a valid react-native platform.
platformplatformExtensions(platform)Returns file extensions that can be mapped to the target platform.