Skip to content

Commit c7fb924

Browse files
committed
Update codegen library path to use from app node_modules
1 parent 7b732df commit c7fb924

File tree

1 file changed

+4
-4
lines changed
  • packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react

1 file changed

+4
-4
lines changed

packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,13 +201,13 @@ class ReactPlugin : Plugin<Project> {
201201

202202
/**
203203
NOTE(flewp): The react-native repository has two "react-native-codegen" projects, one in packages/, and one provided
204-
as a node module by yarn (eventually existing in node_modules). When we build React Native from source, we do not yarn
205-
the react-native project, so we're forcing the codegenDir to point to the packages version if we're in our
206-
Discord-only-TurboModule-codegen build state.
204+
as a node module by yarn (eventually existing in node_modules). Point to the one in the app's node_modules to allow
205+
for specifying different versions of react-native-codegen from the app
206+
(since 'codegenDir' property in library is not supported in this RN version: https://github.com/facebook/react-native/issues/35495)
207207
*/
208208
internal fun Project.getCodegenDir(extension: ReactExtension) = if(project.onlyDiscordTurboModuleCodegen())
209209
project.objects.directoryProperty().convention(
210-
project.rootProject.layout.projectDirectory.dir("../../discord_app/node_modules/react-native/packages/react-native-codegen")
210+
project.rootProject.layout.projectDirectory.dir("../../discord_app/node_modules/react-native-codegen")
211211
)
212212
else extension.codegenDir
213213

0 commit comments

Comments
 (0)