Complete the code to enable Hermes engine in a React Native app.
const isHermesEnabled = [1];Setting isHermesEnabled to true enables the Hermes engine in React Native.
Complete the code to check if Hermes is running in your React Native app.
import { HermesInternal } from 'react-native'; const isHermes = [1] !== null && HermesInternal !== undefined;
HermesInternal is a special object available only when Hermes is enabled and running.
Fix the error in the code to properly enable Hermes in android/app/build.gradle.
project.ext.react = [ entryFile: 'index.js', enableHermes: [1] // clean and rebuild if changing ];
In build.gradle, enableHermes must be a boolean true or false, not a string.
Fill both blanks to import and use Hermes in a React Native component.
import React from 'react'; import { Text, View } from 'react-native'; import [1] from 'react-native'; export default function App() { const isHermes = [2] !== null; return ( <View> <Text>{isHermes ? 'Hermes is enabled' : 'Hermes is disabled'}</Text> </View> ); }
You import HermesInternal from react-native and check if it is not null to detect Hermes.
Fill all three blanks to configure Hermes in a React Native app's android/app/build.gradle file.
project.ext.react = [ entryFile: [1], enableHermes: [2], hermesCommand: [3] // path to Hermes compiler ];
Set entryFile to 'index.js', enableHermes to true, and hermesCommand to the Hermes compiler path string.