I am trying to enable Hermes
in a new project but despite I have enabled it in android/app/build.gradle
it is not enabled. I am not able to see Engine: Hermes
text in app as described in documentation. I am using WebStorm 2019.2
project template.
App.js:
// importsconst App = () => { return (<Fragment><StatusBar barStyle="dark-content"/><SafeAreaView><ScrollView contentInsetAdjustmentBehavior="automatic" style={styles.scrollView}><Header/> {global.HermesInternal == null ? null : (<View style={styles.engine}><Text style={styles.footer}>Engine: Hermes</Text></View> )} // rest of the default ui omitted</ScrollView></SafeAreaView></Fragment> );};export default App;
babel.cofig.js:
module.exports = { presets: ['module:metro-react-native-babel-preset'],};
metro.config.js:
module.exports = { transformer: { getTransformOptions: async () => ({ transform: { experimentalImportSupport: false, inlineRequires: false } }) }};
package.js:
{"name": "hermes","version": "0.0.1","private": true,"scripts": {"start": "react-native start","test": "jest","lint": "eslint ." },"dependencies": {"react": "16.8.6","react-native": "0.60.4" },"devDependencies": {"@babel/core": "^7.5.5","@babel/runtime": "^7.5.5","@react-native-community/eslint-config": "^0.0.5","babel-jest": "^24.8.0","eslint": "^6.1.0","jest": "^24.8.0","metro-react-native-babel-preset": "^0.55.0","react-test-renderer": "16.8.6" },"jest": {"preset": "react-native" }}
You can checkout and test the project from here.