isReactNative
Checks if the current environment is React Native. This function returns a boolean indicating whether FCL is running in a React Native environment rather than a browser or Node.js. This is useful for platform-specific functionality and enabling React Native-specific features.
Import
You can import the entire package and access the function:
_10import * as fcl from "@onflow/fcl-core"_10_10fcl.isReactNative()
Or import directly the specific function:
_10import { isReactNative } from "@onflow/fcl-core"_10_10isReactNative()
Usage
_11// Check if running in React Native_11import * as fcl from "@onflow/fcl"_11_11if (fcl.isReactNative()) {_11 console.log("Running in React Native")_11 // Use React Native specific wallet integrations_11 // Enable deep linking for wallet connections_11} else {_11 console.log("Running in browser or Node.js")_11 // Use web-based wallet integrations_11}
Returns
boolean
True if running in React Native environment, false otherwise