Skip to main content

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:


_10
import * as fcl from "@onflow/fcl-core"
_10
_10
fcl.isReactNative()

Or import directly the specific function:


_10
import { isReactNative } from "@onflow/fcl-core"
_10
_10
isReactNative()

Usage


_11
// Check if running in React Native
_11
import * as fcl from "@onflow/fcl"
_11
_11
if (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


Rate this page