Skip to content

Commit 1000cd7

Browse files
committed
fix: use react-native.config.js for linking the library
1 parent 31cf29f commit 1000cd7

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

packages/create-react-native-library/templates/example/example/android/app/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,6 @@ dependencies {
287287
} else {
288288
implementation jscFlavor
289289
}
290-
291-
<% if (project.native) { -%>
292-
implementation project(':<%- project.package %>')
293-
<% } -%>
294290
}
295291

296292
if (isNewArchitectureEnabled()) {

packages/create-react-native-library/templates/example/example/android/app/src/main/java/com/example/{%- project.package %}/MainApplication.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
import com.example.<%- project.package %>.newarchitecture.MainApplicationReactNativeHost;
1313
import java.lang.reflect.InvocationTargetException;
1414
import java.util.List;
15-
<% if (project.native) { -%>
16-
import com.<%- project.package %>.<%- project.name %>Package;
17-
<% } -%>
1815

1916
public class MainApplication extends Application implements ReactApplication {
2017

@@ -31,7 +28,6 @@ protected List<ReactPackage> getPackages() {
3128
List<ReactPackage> packages = new PackageList(this).getPackages();
3229
// Packages that cannot be autolinked yet can be added manually here, for example:
3330
// packages.add(new MyReactNativePackage());
34-
<% if (project.native) { -%>packages.add(new <%- project.name %>Package());<% } -%>
3531
return packages;
3632
}
3733

packages/create-react-native-library/templates/example/example/android/settings.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,3 @@ if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true")
77
include(":ReactAndroid")
88
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
99
}
10-
11-
<% if (project.native) { -%>
12-
include ':<%- project.package %>'
13-
project(':<%- project.package %>').projectDir = new File(rootProject.projectDir, '../../android')
14-
<% } -%>

packages/create-react-native-library/templates/example/example/ios/Podfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ target '<%- project.name %>Example' do
1818
# An absolute path to your application root.
1919
:app_path => "#{Pod::Config.instance.installation_root}/.."
2020
)
21-
<% if (project.native) { -%>
22-
23-
pod '<%- project.identifier %>', :path => '../..'
24-
<% } -%>
2521

2622
# Enables Flipper.
2723
#
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
<% if (project.native) { -%>
5+
dependencies: {
6+
'<%- project.package %>': {
7+
root: path.join(__dirname, '..'),
8+
},
9+
},
10+
<% } -%>
11+
};

0 commit comments

Comments
 (0)