ソースを参照

fixed deepFreezeAndThrowOnMutationInDev

Daniel Zlotin 8 年 前
コミット
0863bff91d
共有2 個のファイルを変更した5 個の追加5 個の削除を含む
  1. 2
    2
      src/deprecated/platformSpecificDeprecated.android.js
  2. 3
    3
      src/deprecated/platformSpecificDeprecated.ios.js

+ 2
- 2
src/deprecated/platformSpecificDeprecated.android.js ファイルの表示

@@ -59,7 +59,7 @@ function navigatorPush(navigator, params) {
59 59
   let adapted = adaptNavigationStyleToScreenStyle(params);
60 60
   adapted = adaptNavigationParams(adapted);
61 61
   adapted.overrideBackPress = params.overrideBackPress;
62
-  
62
+
63 63
   newPlatformSpecific.push(adapted);
64 64
 }
65 65
 
@@ -351,7 +351,7 @@ function addNavigatorParams(screen, navigator = null, idx = '') {
351 351
 
352 352
 function addNavigatorButtons(screen, sideMenuParams) {
353 353
   const Screen = Navigation.getRegisteredScreen(screen.screen);
354
-  Object.assign(screen, Screen.navigatorButtons);
354
+  screen.navigatorButtons = _.cloneDeep(Screen.navigatorButtons);
355 355
 
356 356
   // Get image uri from image id
357 357
   const rightButtons = getRightButtons(screen);

+ 3
- 3
src/deprecated/platformSpecificDeprecated.ios.js ファイルの表示

@@ -185,9 +185,9 @@ function _mergeScreenSpecificSettings(screenID, screenInstanceID, params) {
185 185
   }
186 186
 
187 187
   let navigatorEventID = screenInstanceID + '_events';
188
-  let navigatorButtons = JSON.parse(JSON.stringify(screenClass.navigatorButtons));
188
+  let navigatorButtons = _.cloneDeep(screenClass.navigatorButtons);
189 189
   if (params.navigatorButtons) {
190
-    navigatorButtons = JSON.parse(JSON.stringify(params.navigatorButtons));
190
+    navigatorButtons = _.cloneDeep(params.navigatorButtons);
191 191
   }
192 192
   if (navigatorButtons.leftButtons) {
193 193
     for (let i = 0; i < navigatorButtons.leftButtons.length; i++) {
@@ -230,7 +230,7 @@ function navigatorPush(navigator, params) {
230 230
 
231 231
   Controllers.NavigationControllerIOS(navigator.navigatorID).push({
232 232
     title: params.title,
233
-    subtitle:params.subtitle,
233
+    subtitle: params.subtitle,
234 234
     titleImage: params.titleImage,
235 235
     component: params.screen,
236 236
     animated: params.animated,