Browse Source

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 years ago
parent
commit
1770113321

+ 1
- 1
src/Navigation.js View File

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

+ 6
- 1
src/Screen.js View File

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

+ 3
- 1
src/deprecated/indexDeprecated.android.js View File

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

+ 3
- 1
src/deprecated/indexDeprecated.ios.js View File

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