From 9afd7fac8eeda08db92f4b398248f022a36b6f01 Mon Sep 17 00:00:00 2001 From: Alex Hunt Date: Mon, 3 Jul 2023 11:53:46 +0100 Subject: [PATCH] [docs] Remove static config note in Metro guide, adjust formatting --- docs/metro.md | 8 ++++---- website/versioned_docs/version-0.72/metro.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/metro.md b/docs/metro.md index bf47d13ce54..42ea16ca033 100644 --- a/docs/metro.md +++ b/docs/metro.md @@ -16,7 +16,7 @@ Configuration options for Metro can be customized in your project's `metro.confi Please see [**Configuring Metro**](https://facebook.github.io/metro/docs/configuration) on the Metro website for documentation on all available config options. ::: -In React Native, your Metro config should extend either [@react-native/metro-config](https://www.npmjs.com/package/@react-native/metro-config) or [@expo/metro-config](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps. +In React Native, your Metro config should extend either [`@react-native/metro-config`](https://www.npmjs.com/package/@react-native/metro-config) or [`@expo/metro-config`](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps. Below is the default `metro.config.js` file in a React Native template project: @@ -35,14 +35,14 @@ const config = {}; module.exports = mergeConfig(getDefaultConfig(__dirname), config); ``` -Metro options you wish to customize can be done so within the `config` object. We strongly recommend defining all config values statically within this file. +Metro options you wish to customize can be done so within the `config` object. ### Advanced: Using a config function Exporting a config function is an opt-in to managing the final config yourself — **Metro will not apply any internal defaults**. This pattern can be useful when needing to read the base default config object from Metro or to set options dynamically. :::info -**From @react-native/metro-config `0.72.1`**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below. +**From `@react-native/metro-config` 0.72.1**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below. ::: @@ -66,7 +66,7 @@ module.exports = function (baseConfig) { ``` :::tip -Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from **@react-native/metro-config**. +Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from `@react-native/metro-config`. **Alternative** diff --git a/website/versioned_docs/version-0.72/metro.md b/website/versioned_docs/version-0.72/metro.md index bf47d13ce54..42ea16ca033 100644 --- a/website/versioned_docs/version-0.72/metro.md +++ b/website/versioned_docs/version-0.72/metro.md @@ -16,7 +16,7 @@ Configuration options for Metro can be customized in your project's `metro.confi Please see [**Configuring Metro**](https://facebook.github.io/metro/docs/configuration) on the Metro website for documentation on all available config options. ::: -In React Native, your Metro config should extend either [@react-native/metro-config](https://www.npmjs.com/package/@react-native/metro-config) or [@expo/metro-config](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps. +In React Native, your Metro config should extend either [`@react-native/metro-config`](https://www.npmjs.com/package/@react-native/metro-config) or [`@expo/metro-config`](https://www.npmjs.com/package/@expo/metro-config). These packages contain essential defaults necessary to build and run React Native apps. Below is the default `metro.config.js` file in a React Native template project: @@ -35,14 +35,14 @@ const config = {}; module.exports = mergeConfig(getDefaultConfig(__dirname), config); ``` -Metro options you wish to customize can be done so within the `config` object. We strongly recommend defining all config values statically within this file. +Metro options you wish to customize can be done so within the `config` object. ### Advanced: Using a config function Exporting a config function is an opt-in to managing the final config yourself — **Metro will not apply any internal defaults**. This pattern can be useful when needing to read the base default config object from Metro or to set options dynamically. :::info -**From @react-native/metro-config `0.72.1`**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below. +**From `@react-native/metro-config` 0.72.1**, it is no longer necessary to use a config function to access the complete default config. See the **Tip** section below. ::: @@ -66,7 +66,7 @@ module.exports = function (baseConfig) { ``` :::tip -Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from **@react-native/metro-config**. +Using a config function is for advanced use cases. A simpler method than the above, e.g. for customising `sourceExts`, would be to read these defaults from `@react-native/metro-config`. **Alternative**