This repository was archived by the owner on May 20, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -482,7 +482,15 @@ function codePushify(options = {}) {
482
482
}
483
483
484
484
render ( ) {
485
- return < RootComponent { ...this . props } ref = { "rootComponent" } />
485
+ const props = { ...this . props } ;
486
+
487
+ // we can set ref property on class components only (not stateless)
488
+ // check it by render method
489
+ if ( RootComponent . prototype . render ) {
490
+ props . ref = "rootComponent" ;
491
+ }
492
+
493
+ return < RootComponent { ...props } />
486
494
}
487
495
}
488
496
}
Original file line number Diff line number Diff line change 1
1
// Adapted from https://raw.githubusercontent.com/facebook/react-native/master/local-cli/generator-android/templates/src/app/react.gradle
2
2
3
+ import java.nio.file.Paths ;
4
+
3
5
def config = project. hasProperty(" react" ) ? project. react : [];
4
6
def bundleAssetName = config. bundleAssetName ?: " index.android.bundle"
5
7
@@ -22,7 +24,10 @@ gradle.projectsEvaluated {
22
24
def productFlavors = android. productFlavors. collect { flavor -> flavor. name }
23
25
if (! productFlavors) productFlavors. add(' ' )
24
26
def nodeModulesPath;
25
- if (project. hasProperty(' nodeModulesPath' )) {
27
+ if (config. root) {
28
+ nodeModulesPath = Paths . get(config. root, " /node_modules" );
29
+ }
30
+ else if (project. hasProperty(' nodeModulesPath' )) {
26
31
nodeModulesPath = project. nodeModulesPath
27
32
} else {
28
33
nodeModulesPath = " ../../node_modules" ;
You can’t perform that action at this time.
0 commit comments