Bladeren bron

migrate to using regular export

Daniel Zlotin 7 jaren geleden
bovenliggende
commit
ee675c516f

+ 1
- 2
lib/src/Navigation.js Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

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

+ 1
- 0
package.json Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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 Bestand weergeven

@@ -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');