Browse Source

migrate to using regular export

Daniel Zlotin 7 years ago
parent
commit
ee675c516f

+ 1
- 2
lib/src/Navigation.js View File

@@ -134,5 +134,4 @@ class Navigation {
134 134
   }
135 135
 }
136 136
 
137
-const singleton = new Navigation();
138
-module.exports = singleton;
137
+export const singleton = new Navigation();

+ 0
- 4
lib/src/index.js View File

@@ -1,4 +0,0 @@
1
-const Navigation = require('./Navigation');
2
-
3
-module.exports = Navigation;
4
-module.exports.default = Navigation;

+ 3
- 0
lib/src/index.ts View File

@@ -0,0 +1,3 @@
1
+import { singleton } from "./Navigation";
2
+
3
+export const Navigation = singleton;

+ 1
- 0
package.json View File

@@ -169,6 +169,7 @@
169 169
       "import/order": 0,
170 170
       "import/named": 0,
171 171
       "import/no-unassigned-import": 0,
172
+      "import/prefer-default-export": 0,
172 173
       "import/no-unresolved": [
173 174
         2,
174 175
         {

+ 1
- 1
playground/src/app.js View File

@@ -1,4 +1,4 @@
1
-const Navigation = require('react-native-navigation');
1
+const { Navigation } = require('react-native-navigation');
2 2
 const { registerScreens } = require('./screens');
3 3
 
4 4
 function start() {

+ 1
- 1
playground/src/screens/CustomDialog.js View File

@@ -2,7 +2,7 @@ const React = require('react');
2 2
 const { PureComponent } = require('react');
3 3
 
4 4
 const { View, Text, Button } = require('react-native');
5
-const Navigation = require('react-native-navigation');
5
+const { Navigation } = require('react-native-navigation');
6 6
 
7 7
 class CustomDialog extends PureComponent {
8 8
 

+ 1
- 1
playground/src/screens/CustomTransitionDestination.js View File

@@ -1,7 +1,7 @@
1 1
 const React = require('react');
2 2
 const { Component } = require('react');
3 3
 const { View, TouchableOpacity, Image, Text } = require('react-native');
4
-const Navigation = require('react-native-navigation');
4
+const { Navigation } = require('react-native-navigation');
5 5
 
6 6
 class CustomTransitionDestination extends Component {
7 7
   constructor(props) {

+ 1
- 1
playground/src/screens/CustomTransitionOrigin.js View File

@@ -1,7 +1,7 @@
1 1
 const React = require('react');
2 2
 const { Component } = require('react');
3 3
 const { View, Text, Image, TouchableOpacity } = require('react-native');
4
-const Navigation = require('react-native-navigation');
4
+const { Navigation } = require('react-native-navigation');
5 5
 
6 6
 class CustomTransitionOrigin extends Component {
7 7
   constructor(props) {

+ 1
- 1
playground/src/screens/LifecycleScreen.js View File

@@ -3,7 +3,7 @@ const { Component } = require('react');
3 3
 
4 4
 const { View, Text, Button } = require('react-native');
5 5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 class LifecycleScreen extends Component {

+ 1
- 1
playground/src/screens/ModalScreen.js View File

@@ -5,7 +5,7 @@ const { Component } = require('react');
5 5
 
6 6
 const { View, Text, Button } = require('react-native');
7 7
 
8
-const Navigation = require('react-native-navigation');
8
+const { Navigation } = require('react-native-navigation');
9 9
 const testIDs = require('../testIDs');
10 10
 
11 11
 class ModalScreen extends Component {

+ 1
- 1
playground/src/screens/OptionsScreen.js View File

@@ -3,7 +3,7 @@ const { Component } = require('react');
3 3
 
4 4
 const { View, Text, Button } = require('react-native');
5 5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 const BUTTON_ONE = 'buttonOne';

+ 1
- 1
playground/src/screens/OrientationDetectScreen.js View File

@@ -3,7 +3,7 @@ const { Component } = require('react');
3 3
 
4 4
 const { View, Text, Button } = require('react-native');
5 5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 class OrientationDetectScreen extends Component {

+ 1
- 1
playground/src/screens/OrientationSelectScreen.js View File

@@ -2,7 +2,7 @@ const React = require('react');
2 2
 const { Component } = require('react');
3 3
 const { View, Text, Button } = require('react-native');
4 4
 
5
-const Navigation = require('react-native-navigation');
5
+const { Navigation } = require('react-native-navigation');
6 6
 const testIDs = require('../testIDs');
7 7
 
8 8
 class OrientationSelectScreen extends Component {

+ 1
- 1
playground/src/screens/PushedScreen.js View File

@@ -5,7 +5,7 @@ const { Component } = require('react');
5 5
 
6 6
 const { View, Text, Button } = require('react-native');
7 7
 
8
-const Navigation = require('react-native-navigation');
8
+const { Navigation } = require('react-native-navigation');
9 9
 const testIDs = require('../testIDs');
10 10
 
11 11
 class PushedScreen extends Component {

+ 1
- 1
playground/src/screens/ScrollViewScreen.js View File

@@ -3,7 +3,7 @@ const { Component } = require('react');
3 3
 
4 4
 const { StyleSheet, ScrollView, View, Button } = require('react-native');
5 5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 class ScrollViewScreen extends Component {

+ 1
- 1
playground/src/screens/SideMenuScreen.js View File

@@ -3,7 +3,7 @@ const { Component } = require('react');
3 3
 
4 4
 const { View, Text, Button } = require('react-native');
5 5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 class SideMenuScreen extends Component {

+ 1
- 1
playground/src/screens/TextScreen.js View File

@@ -3,7 +3,7 @@ const { Component } = require('react');
3 3
 
4 4
 const { View, Text, Button } = require('react-native');
5 5
 
6
-const Navigation = require('react-native-navigation');
6
+const { Navigation } = require('react-native-navigation');
7 7
 const testIDs = require('../testIDs');
8 8
 
9 9
 let globalFirstComponentID;

+ 1
- 1
playground/src/screens/TopTabOptionsScreen.js View File

@@ -2,7 +2,7 @@ const React = require('react');
2 2
 const { PureComponent } = require('react');
3 3
 const testIDs = require('../testIDs');
4 4
 const { View, Text, Button } = require('react-native');
5
-const Navigation = require('react-native-navigation');
5
+const { Navigation } = require('react-native-navigation');
6 6
 
7 7
 class TopTabOptionsScreen extends PureComponent {
8 8
   static get options() {

+ 1
- 1
playground/src/screens/TopTabScreen.js View File

@@ -1,7 +1,7 @@
1 1
 const React = require('react');
2 2
 const { PureComponent } = require('react');
3 3
 const { View, Text } = require('react-native');
4
-const Navigation = require('react-native-navigation');
4
+const { Navigation } = require('react-native-navigation');
5 5
 
6 6
 class TopTabScreen extends PureComponent {
7 7
   static get options() {

+ 1
- 1
playground/src/screens/WelcomeScreen.js View File

@@ -4,7 +4,7 @@ const { View, Text, Button } = require('react-native');
4 4
 
5 5
 const testIDs = require('../testIDs');
6 6
 
7
-const Navigation = require('react-native-navigation');
7
+const { Navigation } = require('react-native-navigation');
8 8
 
9 9
 class WelcomeScreen extends Component {
10 10
   static get options() {

+ 1
- 1
playground/src/screens/index.js View File

@@ -1,4 +1,4 @@
1
-const Navigation = require('react-native-navigation');
1
+const { Navigation } = require('react-native-navigation');
2 2
 const WelcomeScreen = require('./WelcomeScreen');
3 3
 const TextScreen = require('./TextScreen');
4 4
 const PushedScreen = require('./PushedScreen');