File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
packages/out-of-tree-platforms Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,14 @@ type ResolverConfig = {
1414 platformNameMap : { [ platform : string ] : string } ,
1515} ;
1616
17+ /**
18+ * Creates a custom Metro resolver that maps platform extensions to package names.
19+ * To be used in app's `metro.config.js` as `resolver.resolveRequest`.
20+ */
1721const getPlatformResolver = ( config : ResolverConfig ) : CustomResolver => {
1822 return ( context , moduleName , platform ) => {
23+ // `customResolverOptions` is populated through `?resolver.platformExtension` query params
24+ // in the jsBundleURLForBundleRoot method of the react-native/React/Base/RCTBundleURLProvider.mm
1925 const platformExtension = context . customResolverOptions ?. platformExtension ;
2026 let modifiedModuleName = moduleName ;
2127
You can’t perform that action at this time.
0 commit comments