You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// example from react-native-camera-roll: https://github.com/react-native-cameraroll/react-native-cameraroll/blob/8a6d1b4279c76e5682a4b443e7a4e111e774ec0a/package.json#L118-L127
43
+
// "RNCPHAssetLoader",
44
+
],
45
+
"RCTURLRequestHandler": [
46
+
"<iOS-class-conforming-to-RCTURLRequestHandler>",
47
+
// example from react-native-camera-roll: https://github.com/react-native-cameraroll/react-native-cameraroll/blob/8a6d1b4279c76e5682a4b443e7a4e111e774ec0a/package.json#L118-L127
48
+
// "RNCPHAssetUploader",
49
+
],
50
+
"RCTImageDataDecoder": [
51
+
"<iOS-class-conforming-to-RCTImageDataDecoder>",
52
+
// we don't have a good example for this, but it works in the same way. Pass the name of the class that implements the RCTImageDataDecoder. It must be a Native Module.
@@ -46,7 +67,13 @@ You can add this snippet to your app and customize the various fields:
46
67
-`components:` use this value if you only need to generate code for Native Fabric Components.
47
68
-`all`: use this value if you have a mixture of components and modules.
48
69
-`jsSrcsDir`: this is the root folder where all your specs live.
49
-
-`android.javaPackageName`: this is an android specific setting to let **Codegen** generate the files in a custom package.
70
+
-`android.javaPackageName`: this is an Android specific setting to let **Codegen** generate the files in a custom package.
71
+
-`ios`: the `ios` field is an object that can be used by app developers and library maintainers to provide some advanced functionalities. All the following fields are **optional**.
72
+
-`ios.modulesConformingToProtocol`: React Native offers some protocols that native modules can implement to customize some behaviors. These fields allow you to define the list of module that conforms to those protocols. These modules will be injected in the React Native runtime when the app starts.
73
+
-`ios.modulesConformingToProtocol.RCTImageURLLoader`: list of iOS native module that implements the [`RCTImageURLLoader` protocol](https://github.com/facebook/react-native/blob/00d5caee9921b6c10be8f7d5b3903c6afe8dbefa/packages/react-native/Libraries/Image/RCTImageURLLoader.h#L26-L81). You need to pass the class names of iOS classes that implements the `RCTImageURLLoader`. They must be Native Modules.
74
+
-`ios.modulesConformingToProtocol.RCTURLRequestHandler`: list of iOS native module that implements the [`RCTURLRequestHandler` protocol](https://github.com/facebook/react-native/blob/00d5caee9921b6c10be8f7d5b3903c6afe8dbefa/packages/react-native/React/Base/RCTURLRequestHandler.h#L11-L52). You need to pass the class names of iOS classes that implements the `RCTURLRequestHandler`. They must be Native Modules.
75
+
-`ios.modulesConformingToProtocol.RCTImageDataDecoder`: list of iOS native module that implements the [`RCTImageDataDecoder` protocol](https://github.com/facebook/react-native/blob/00d5caee9921b6c10be8f7d5b3903c6afe8dbefa/packages/react-native/Libraries/Image/RCTImageDataDecoder.h#L15-L53). You need to pass the class names of iOS classes that implements the `RCTImageDataDecoder`. They must be Native Modules.
76
+
-`ios.componentProvider`: this field is a map used to generate the association between a custom JS React component and the native class that implements it. The key of the map is the JS name of the component (for example `TextInput`), and the value is the iOS class that implements the component (for example `RCTTextInput`).
50
77
51
78
When **Codegen** runs, it searches among all the dependencies of the app, looking for JS files that respects some specific conventions, and it generates the required code:
// example from react-native-camera-roll: https://github.com/react-native-cameraroll/react-native-cameraroll/blob/8a6d1b4279c76e5682a4b443e7a4e111e774ec0a/package.json#L118-L127
43
+
// "RNCPHAssetLoader",
44
+
],
45
+
"RCTURLRequestHandler": [
46
+
"<iOS-class-conforming-to-RCTURLRequestHandler>",
47
+
// example from react-native-camera-roll: https://github.com/react-native-cameraroll/react-native-cameraroll/blob/8a6d1b4279c76e5682a4b443e7a4e111e774ec0a/package.json#L118-L127
48
+
// "RNCPHAssetUploader",
49
+
],
50
+
"RCTImageDataDecoder": [
51
+
"<iOS-class-conforming-to-RCTImageDataDecoder>",
52
+
// we don't have a good example for this, but it works in the same way. Pass the name of the class that implements the RCTImageDataDecoder. It must be a Native Modules.
53
+
]
54
+
}
37
55
}
38
56
},
39
57
```
@@ -46,7 +64,12 @@ You can add this snippet to your app and customize the various fields:
46
64
-`components:` use this value if you only need to generate code for Native Fabric Components.
47
65
-`all`: use this value if you have a mixture of components and modules.
48
66
-`jsSrcsDir`: this is the root folder where all your specs live.
49
-
-`android.javaPackageName`: this is an android specific setting to let **Codegen** generate the files in a custom package.
67
+
-`android.javaPackageName`: this is an Android specific setting to let **Codegen** generate the files in a custom package.
68
+
-`ios`: the `ios` field is an object that can be used by app developers and library maintainers to provide some advanced functionalities. All the following fields are **optional**.
69
+
-`ios.modulesConformingToProtocol`: React Native offers some protocols that native modules can implement to customize some behaviors. These fields allow you to define the list of modules that conform to those protocols. These modules will be injected in the React Native runtime when the app starts.
70
+
-`ios.modulesConformingToProtocol.RCTImageURLLoader`: list of iOS native module that implements the [`RCTImageURLLoader` protocol](https://github.com/facebook/react-native/blob/00d5caee9921b6c10be8f7d5b3903c6afe8dbefa/packages/react-native/Libraries/Image/RCTImageURLLoader.h#L26-L81). You need to pass the class names of iOS classes that implements the `RCTImageURLLoader`. They must be Native Modules.
71
+
-`ios.modulesConformingToProtocol.RCTURLRequestHandler`: list of iOS native module that implements the [`RCTURLRequestHandler` protocol](https://github.com/facebook/react-native/blob/00d5caee9921b6c10be8f7d5b3903c6afe8dbefa/packages/react-native/React/Base/RCTURLRequestHandler.h#L11-L52). You need to pass the class names of iOS classes that implements the `RCTURLRequestHandler`. They must be Native Modules.
72
+
-`ios.modulesConformingToProtocol.RCTImageDataDecoder`: list of iOS native module that implements the [`RCTImageDataDecoder` protocol](https://github.com/facebook/react-native/blob/00d5caee9921b6c10be8f7d5b3903c6afe8dbefa/packages/react-native/Libraries/Image/RCTImageDataDecoder.h#L15-L53). You need to pass the class names of iOS classes that implements the `RCTImageDataDecoder`. They must be Native Modules.
50
73
51
74
When **Codegen** runs, it searches among all the dependencies of the app, looking for JS files that respects some specific conventions, and it generates the required code:
0 commit comments