mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
398b3b3be4
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47670 Now that we have `babel-plugin-syntax-hermes-parser` in `react-native/babel-preset` (since D63535216), it's no longer necessary to use `hermes-parser` directly in Metro in order to use newer Flow syntax. Babel with `babel-plugin-syntax-hermes-parser` is generally preferable, because it intelligently falls back to parsing with Babel for any non-`flow` files. See https://github.com/facebook/hermes/issues/1549 for context. Changelog: [General][Fixed] metro-config: Don't use `hermes-parser` by default, prefer `babel-plugin-syntax-hermes-parser`, which supports other syntax plugins. Reviewed By: huntie Differential Revision: D66002056 fbshipit-source-id: cf48acec347e2c0791872f8ca4b53f5f8af1c783
@react-native/metro-config
Installation
yarn add --dev @react-native/js-polyfills metro-config @react-native/metro-babel-transformer metro-runtime @react-native/metro-config
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest packages/metro-config.