Bläddra i källkod

Export `Navigator` class for public use (#1647)

* Make Navigator Public

* Make Screen.js export both Screen and Navigator

* Update Navigation.js to import Screen correctly

* Make Navigator public for Android too

* Forgot to export after importing

* ESLint fix

* ESLint fix

* ESLint Fix

* ESLint Fix
PC Futures 7 år sedan
förälder
incheckning
1770113321

+ 1
- 1
src/Navigation.js Visa fil

@@ -2,7 +2,7 @@
2 2
 import React from 'react';
3 3
 import {AppRegistry} from 'react-native';
4 4
 import platformSpecific from './deprecated/platformSpecificDeprecated';
5
-import Screen from './Screen';
5
+import {Screen} from './Screen';
6 6
 
7 7
 import PropRegistry from './PropRegistry';
8 8
 

+ 6
- 1
src/Screen.js Visa fil

@@ -175,7 +175,7 @@ class Navigator {
175 175
   }
176 176
 }
177 177
 
178
-export default class Screen extends Component {
178
+class Screen extends Component {
179 179
   static navigatorStyle = {};
180 180
   static navigatorButtons = {};
181 181
 
@@ -193,3 +193,8 @@ export default class Screen extends Component {
193 193
     }
194 194
   }
195 195
 }
196
+
197
+export {
198
+  Screen,
199
+  Navigator
200
+};

+ 3
- 1
src/deprecated/indexDeprecated.android.js Visa fil

@@ -2,10 +2,12 @@ import Navigation from './../Navigation';
2 2
 import SharedElementTransition from './../views/sharedElementTransition';
3 3
 import NativeEventsReceiver from './../NativeEventsReceiver';
4 4
 import ScreenVisibilityListener from './../ScreenVisibilityListener';
5
+import {Navigator} from './../Screen';
5 6
 
6 7
 module.exports = {
7 8
   Navigation,
8 9
   SharedElementTransition,
9 10
   NativeEventsReceiver,
10
-  ScreenVisibilityListener
11
+  ScreenVisibilityListener,
12
+  Navigator
11 13
 };

+ 3
- 1
src/deprecated/indexDeprecated.ios.js Visa fil

@@ -3,11 +3,13 @@ import {NavigationToolBarIOS} from './controllers';
3 3
 import SharedElementTransition from '../views/sharedElementTransition';
4 4
 import NativeEventsReceiver from './../NativeEventsReceiver';
5 5
 import ScreenVisibilityListener from './../ScreenVisibilityListener';
6
+import {Navigator} from './../Screen';
6 7
 
7 8
 module.exports = {
8 9
   Navigation,
9 10
   NavigationToolBarIOS,
10 11
   SharedElementTransition,
11 12
   NativeEventsReceiver,
12
-  ScreenVisibilityListener
13
+  ScreenVisibilityListener,
14
+  Navigator
13 15
 };