Как включить/отключить Hermes на основе переменных среды Android/iOS в React Native?Android

Форум для тех, кто программирует под Android
Anonymous
Как включить/отключить Hermes на основе переменных среды Android/iOS в React Native?

Сообщение Anonymous »

Из-за проблем совместимости Hermes (в RN +71.0) с React Native Debugger я хочу отключить Hermes при разработке и включить его в рабочей среде автоматически с помощью ENV-файлов, специфичных для Android/iOS.
В gradle.properties:

Код: Выделить всё

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
hermesEnabled=true
В подфайле:

Код: Выделить всё

  use_react_native!(
.....

# Hermes is now enabled by default. Disable by setting this flag to false.
# Upcoming versions of React Native may rely on get_default_flags(), but
# we make it explicit here to aid in the React Native upgrade process.
:hermes_enabled => true,

.....
)
Я не совсем знаком с настройкой переменных среды Android/iOS, поэтому мне интересно, как я могу использовать их для включения/выключения Hermes в зависимости от моей среды?

Вернуться в «Android»