From 50b366e7341f201d29a44f20b7771b3a832b0045 Mon Sep 17 00:00:00 2001 From: osdnk Date: Tue, 28 Jan 2020 15:40:08 +0100 Subject: [PATCH] fix: rtl in native app example --- example/ios/Podfile.lock | 17 +++++++++++++++-- example/package.json | 2 ++ example/src/index.tsx | 8 +++++++- yarn.lock | 10 ++++++++++ 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock index fe378151..4980b3f4 100644 --- a/example/ios/Podfile.lock +++ b/example/ios/Podfile.lock @@ -2,6 +2,8 @@ PODS: - boost-for-react-native (1.63.0) - DoubleConversion (1.1.6) - EXAppLoaderProvider (8.0.0) + - EXBlur (8.0.0): + - UMCore - EXConstants (8.0.0): - UMConstantsInterface - UMCore @@ -48,6 +50,8 @@ PODS: - glog - glog (0.3.5) - RCTRequired (0.61.5) + - RCTRestart (0.0.13): + - React - RCTTypeSafety (0.61.5): - FBLazyVector (= 0.61.5) - Folly (= 2018.10.22.00) @@ -253,7 +257,7 @@ PODS: - React - RNReanimated (1.4.0): - React - - RNScreens (2.0.0-alpha.22): + - RNScreens (2.0.0-alpha.31): - React - UMBarCodeScannerInterface (5.0.0) - UMCameraInterface (5.0.0) @@ -275,6 +279,7 @@ PODS: DEPENDENCIES: - DoubleConversion (from `../../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) - EXAppLoaderProvider (from `../../node_modules/expo-app-loader-provider/ios`) + - EXBlur (from `../../node_modules/expo-blur/ios`) - EXConstants (from `../../node_modules/expo-constants/ios`) - EXErrorRecovery (from `../../node_modules/expo-error-recovery/ios`) - EXFileSystem (from `../../node_modules/expo-file-system/ios`) @@ -290,6 +295,7 @@ DEPENDENCIES: - Folly (from `../../node_modules/react-native/third-party-podspecs/Folly.podspec`) - glog (from `../../node_modules/react-native/third-party-podspecs/glog.podspec`) - RCTRequired (from `../../node_modules/react-native/Libraries/RCTRequired`) + - RCTRestart (from `../../node_modules/react-native-restart/ios`) - RCTTypeSafety (from `../../node_modules/react-native/Libraries/TypeSafety`) - React (from `../../node_modules/react-native/`) - React-Core (from `../../node_modules/react-native/`) @@ -340,6 +346,9 @@ EXTERNAL SOURCES: EXAppLoaderProvider: :path: !ruby/object:Pathname path: "../../node_modules/expo-app-loader-provider/ios" + EXBlur: + :path: !ruby/object:Pathname + path: "../../node_modules/expo-blur/ios" EXConstants: :path: !ruby/object:Pathname path: "../../node_modules/expo-constants/ios" @@ -380,6 +389,8 @@ EXTERNAL SOURCES: :podspec: "../../node_modules/react-native/third-party-podspecs/glog.podspec" RCTRequired: :path: "../../node_modules/react-native/Libraries/RCTRequired" + RCTRestart: + :path: "../../node_modules/react-native-restart/ios" RCTTypeSafety: :path: "../../node_modules/react-native/Libraries/TypeSafety" React: @@ -469,6 +480,7 @@ SPEC CHECKSUMS: boost-for-react-native: 39c7adb57c4e60d6c5479dd8623128eb5b3f0f2c DoubleConversion: 5805e889d232975c086db112ece9ed034df7a0b2 EXAppLoaderProvider: ebdb6bc2632c1ccadbe49f5e4104d8d690969c49 + EXBlur: d1604f66f89a9414f5ee65dfb23874437c1bb147 EXConstants: 4051b16c17ef3defa03c541d42811dc92b249146 EXErrorRecovery: d36db99ec6a3808f313f01b0890eb443796dd1c2 EXFileSystem: 6e0d9bb6cc4ea404dbb8f583c1a8a2dcdf4b83b6 @@ -484,6 +496,7 @@ SPEC CHECKSUMS: Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51 glog: 1f3da668190260b06b429bb211bfbee5cd790c28 RCTRequired: b153add4da6e7dbc44aebf93f3cf4fcae392ddf1 + RCTRestart: dd19aab87fc1118e05b6b5b91b959105647f56b4 RCTTypeSafety: 9aa1b91d7f9310fc6eadc3cf95126ffe818af320 React: b6a59ef847b2b40bb6e0180a97d0ca716969ac78 React-Core: 688b451f7d616cc1134ac95295b593d1b5158a04 @@ -506,7 +519,7 @@ SPEC CHECKSUMS: RNCMaskedView: dd13f9f7b146a9ad82f9b7eb6c9b5548fcf6e990 RNGestureHandler: 02905abe54e1f6e59c081a10b4bd689721e17aa6 RNReanimated: b2ab0b693dddd2339bd2f300e770f6302d2e960c - RNScreens: 6adf01eb4080f44af6cca551207c6b0505066857 + RNScreens: 5fcc247984ffae92240e7e8e39e1e19c0a0f6f67 UMBarCodeScannerInterface: 3802c8574ef119c150701d679ab386e2266d6a54 UMCameraInterface: 985d301f688ed392f815728f0dd906ca34b7ccb1 UMConstantsInterface: bda5f8bd3403ad99e663eb3c4da685d063c5653c diff --git a/example/package.json b/example/package.json index 4803c98a..3454da48 100644 --- a/example/package.json +++ b/example/package.json @@ -13,6 +13,7 @@ "dependencies": { "@expo/vector-icons": "^10.0.0", "@react-native-community/masked-view": "0.1.5", + "@types/react-native-restart": "^0.0.0", "color": "^3.1.2", "expo": "^36.0.2", "expo-asset": "~8.0.0", @@ -23,6 +24,7 @@ "react-native-gesture-handler": "~1.5.3", "react-native-paper": "^3.5.0", "react-native-reanimated": "^1.4.0", + "react-native-restart": "^0.0.13", "react-native-safe-area-context": "^0.6.2", "react-native-screens": "^2.0.0-alpha.31", "react-native-tab-view": "2.11.0", diff --git a/example/src/index.tsx b/example/src/index.tsx index 70a923e4..fe529d22 100644 --- a/example/src/index.tsx +++ b/example/src/index.tsx @@ -7,6 +7,7 @@ import { StatusBar, I18nManager, } from 'react-native'; +import RNRestart from 'react-native-restart'; import { MaterialIcons } from '@expo/vector-icons'; import { Provider as PaperProvider, @@ -248,7 +249,12 @@ export default function App() { value={I18nManager.isRTL} onValueChange={() => { I18nManager.forceRTL(!I18nManager.isRTL); - Updates.reloadFromCache(); + // @ts-ignore + if (global.Expo) { + Updates.reloadFromCache(); + } else { + RNRestart.Restart(); + } }} /> diff --git a/yarn.lock b/yarn.lock index d7ea2aad..baadfa0b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3088,6 +3088,11 @@ dependencies: "@types/react" "*" +"@types/react-native-restart@^0.0.0": + version "0.0.0" + resolved "https://registry.yarnpkg.com/@types/react-native-restart/-/react-native-restart-0.0.0.tgz#5c86bd8d3acb9dc8c8e41963cc038b8ac76d3271" + integrity sha512-MLawyWpEkVlzxAZkdWDYabpL4zPRo7oBd1gE683WEr/7szwh+WVIjReSsLdFeRiiFoNuEEjAthnGx2YLFzwHEQ== + "@types/react-native-vector-icons@^6.4.5": version "6.4.5" resolved "https://registry.yarnpkg.com/@types/react-native-vector-icons/-/react-native-vector-icons-6.4.5.tgz#74cbfc564bd8435e43ad6728572a0e5b49c335d1" @@ -13576,6 +13581,11 @@ react-native-reanimated@^1.4.0: resolved "https://registry.yarnpkg.com/react-native-reanimated/-/react-native-reanimated-1.4.0.tgz#7f1acbf9be08492d834f512700570978052be2f9" integrity sha512-tO7nSNNP+iRLVbkcSS5GXyDBb7tSI02+XuRL3/S39EAr35rnvUy2JfeLUQG+fWSObJjnMVhasUDEUwlENk8IXw== +react-native-restart@^0.0.13: + version "0.0.13" + resolved "https://registry.yarnpkg.com/react-native-restart/-/react-native-restart-0.0.13.tgz#88003fd6b1cce9de5bafa2570ba4ef8ff1ea2937" + integrity sha512-p4rBiTliPiJEejA0IhExHuM7Ge6TuLpUAm98TbtkmiISWDRK2a/DeZ4Wno7bawcMr1Yb6O5eeTHPO0rUltRD/A== + react-native-safe-area-context@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/react-native-safe-area-context/-/react-native-safe-area-context-0.6.2.tgz#d467ac8a953426bfbb6d8f417222b0dc3952be7a"