diff --git a/docs/source/integrations/react-native.md b/docs/source/integrations/react-native.md index 6264a1137c5..da976e00675 100644 --- a/docs/source/integrations/react-native.md +++ b/docs/source/integrations/react-native.md @@ -48,9 +48,9 @@ For more information on setting up Apollo Client, see [Getting started](../get-s * `Uncaught Error: Cannot read property 'prototype' of undefined`, or similar Metro build error when importing from `@apollo/client` -This is due to the way [the Metro bundler supports `.cjs` and `.mjs` files](https://github.com/facebook/metro/issues/535#issuecomment-1198071838): it requires additional configuration to _implicitly_ resolve files with these extensions, so `import { ApolloClient, InMemoryCache } from '@apollo/client` will result in an error. You can amend your import statement to e.g. `import { ApolloClient, InMemoryCache } from '@apollo/client/main.cjs';`, or you can install `@expo/metro-config` and configure their implicit resolution via `metro.config.js` in the root of your project: +This is due to the way [the Metro bundler supports `.cjs` and `.mjs` files](https://github.com/facebook/metro/issues/535#issuecomment-1198071838): it requires additional configuration to _implicitly_ resolve files with these extensions, so `import { ApolloClient, InMemoryCache } from '@apollo/client'` will result in an error. You can amend your import statement to e.g. `import { ApolloClient, InMemoryCache } from '@apollo/client/main.cjs'`, or you can install `@expo/metro-config` and configure their implicit resolution via `metro.config.js` in the root of your project: -```js +```js title="metro.config.js" const { getDefaultConfig } = require('@expo/metro-config'); const config = getDefaultConfig(__dirname);