Skip to content

Commit

Permalink
fix(flagship): Upgrade to react-native-navigation 6
Browse files Browse the repository at this point in the history
BREAKING CHANGE: upgrade to react-native-navigation 6
Should not affect most cases.
https://github.com/wix/react-native-navigation/blob/master/CHANGELOG.md#breaking-changes

Fixes issues with tab bar icons not showing up in iOS 14.
  • Loading branch information
Cauldrath authored and bweissbart committed Sep 14, 2020
1 parent b4ff9ad commit 94dfaa7
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
"react-art": "^16.4.0",
"react-dom": "^16.9.0",
"react-native": "^0.61.0",
"react-native-navigation": "^4.0.0",
"react-native-navigation": "^6.0.0",
"react-native-svg": "^10.0.0",
"react-native-web": "^0.12.2",
"react-native-web-modal": "^1.0.1",
Expand Down
2 changes: 0 additions & 2 deletions packages/flagship/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionName project.VERSION_NAME
versionCode "${project.VERSION_CODE_SHORT}".toInteger()
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"
}
signingConfigs {
release {
Expand Down Expand Up @@ -194,7 +193,6 @@ dependencies {

implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-navigation')
implementation project(':react-native-restart')

// JSC from node_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,41 @@
import com.reactnativenavigation.react.ReactGateway;

import java.util.Arrays;
import java.util.ArrayList;
import java.util.List;

public class MainApplication extends NavigationApplication {
protected List<ReactPackage> getPackages(Application application, boolean debug) {
@SuppressWarnings("UnnecessaryLocalVariable")
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
packages.add(new NativeConstantsPackage());
packages.add(new EnvSwitcherPackage());
packages.add(new ReactNativeRestartPackage());
return packages;
}

@Override
protected ReactGateway createReactGateway() {
ReactNativeHost host = new NavigationReactNativeHost(this, isDebug(), createAdditionalReactPackages()) {
ReactNativeHost host = new NavigationReactNativeHost(this) {
@Override
protected String getJSMainModuleName() {
return "index";
}
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
public List<ReactPackage> getPackages() {
List<ReactPackage> packages = new PackageList(this).getPackages();
// Packages that cannot be autolinked yet can be added manually here, for example:
packages.add(new NativeConstantsPackage());
packages.add(new EnvSwitcherPackage());
packages.add(new ReactNativeRestartPackage());
return packages;
}

// [CODEPUSH FUNCTIONS INJECT]
};
return new ReactGateway(this, isDebug(), host);
return new ReactGateway(host);
}

@Override
public boolean isDebug() {
// Make sure you are using BuildConfig from your own application
return BuildConfig.DEBUG;
}

@Override
public List<ReactPackage> createAdditionalReactPackages() {
return getPackages(this, BuildConfig.DEBUG);
}

public String getJSMainModuleName() {
return "index";
}
Expand Down
4 changes: 4 additions & 0 deletions packages/flagship/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ buildscript {
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
kotlinVersion = "1.3.72"
RNNKotlinVersion = kotlinVersion
detoxKotlinVersion = kotlinVersion
}
repositories {
google()
Expand All @@ -15,6 +18,7 @@ buildscript {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath("com.android.tools.build:gradle:3.4.2")

// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 0 additions & 2 deletions packages/flagship/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
rootProject.name = 'FLAGSHIP'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':react-native-navigation'
project(':react-native-navigation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-navigation/lib/android/app/')
include ':react-native-restart'
project(':react-native-restart').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-restart/android')
include ':app'
Expand Down
2 changes: 1 addition & 1 deletion packages/fsapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"react-native": "^0.61.0",
"react-native-cookies": "^3.3.0",
"react-native-device-info": "^5.0.0",
"react-native-navigation": "^4.0.0",
"react-native-navigation": "^6.0.0",
"react-native-restart": "git+https://github.com/brandingbrand/react-native-restart#0.0.13-hotfix",
"react-native-sensitive-info": "^5.5.0",
"react-native-web-modal": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/fsengagement/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"react-native-device-info": "^5.0.0",
"react-native-fcm": "^16.0.0",
"react-native-localize": "^1.3.0",
"react-native-navigation": "^4.0.0",
"react-native-navigation": "^6.0.0",
"react-native-snap-carousel": "^3.8.0",
"react-native-video": "^5.0.0",
"react-native-webview": "^8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/fstestproject/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"react-native": "^0.61.0",
"react-native-cookies": "^3.3.0",
"react-native-device-info": "^5.0.0",
"react-native-navigation": "^4.0.0"
"react-native-navigation": "^6.0.0"
},
"publishConfig": {
"registry": "https://registry.npmjs.org/"
Expand Down
2 changes: 1 addition & 1 deletion packages/pirateship/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"react-native-device-info": "^5.0.0",
"react-native-htmlview": "^0.15.0",
"react-native-localize": "^1.3.0",
"react-native-navigation": "^4.0.0",
"react-native-navigation": "^6.0.0",
"react-native-safe-area": "^0.5.0",
"react-native-sensitive-info": "^5.5.0",
"react-native-svg": "^10.0.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13890,10 +13890,10 @@ react-native-masked-text@^1.13.0:
date-and-time "0.9.0"
tinymask "1.0.2"

react-native-navigation@^4.0.0:
version "4.8.4"
resolved "https://registry.yarnpkg.com/react-native-navigation/-/react-native-navigation-4.8.4.tgz#a9e4c272054d831c66bb406c5f164c108ba8e942"
integrity sha512-aORJK7B2Jih29wmszRwV3zwuIwrXWtQjdVm0bVMMzk0iPKJMMrCvW+GZIAxxHhJfKEdy7GNCdyRv0g43/Frj2A==
react-native-navigation@^6.0.0:
version "6.11.0"
resolved "https://registry.yarnpkg.com/react-native-navigation/-/react-native-navigation-6.11.0.tgz#58b3d5a41c21d4c4dd9f0e7a1933b1b68ee25d41"
integrity sha512-VoOGHEMcyrmHsGwy40ILtmKzOyNPNGE6y81PQGU7BvbzJOG0iOjGuZ9QqBYaJycseO95IJpeh3ekE3XRoAMYJQ==
dependencies:
hoist-non-react-statics "3.x.x"
lodash "4.17.x"
Expand Down

0 comments on commit 94dfaa7

Please sign in to comment.