From 3b84d993d1d83cef1952367bfe66c8125bce532c Mon Sep 17 00:00:00 2001 From: Will Ernst Date: Mon, 29 Apr 2024 15:27:14 -0700 Subject: [PATCH] fixup metro config snippet in docs --- packages/docs/src/pages/frameworks/react-native.mdx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/docs/src/pages/frameworks/react-native.mdx b/packages/docs/src/pages/frameworks/react-native.mdx index 5d8258a9..c48a7660 100644 --- a/packages/docs/src/pages/frameworks/react-native.mdx +++ b/packages/docs/src/pages/frameworks/react-native.mdx @@ -69,11 +69,14 @@ Some Triplit packages use [Package Exports](https://nodejs.org/docs/latest-v18.x but we found it broke other parts of the package resolution process. -To handle these imports, you will need to add a `metro.config.js` file to the root of your project with the following content: +To handle these imports, you will need to customize the Metro bundler. If you have not already created a `metro.config.js` file, please see the Expo docs on properly [configuring Metro](https://docs.expo.dev/guides/customizing-metro/). Once you have created a `metro.config.js` file, you can add the following code to resolve the exports from the Triplit packages: ```javascript const { getDefaultConfig } = require('expo/metro-config'); const path = require('path'); +const config = getDefaultConfig(__dirname); + +// additional configuration steps // Resolve exports from @triplit/db function customResolver(context, moduleName, platform) {