Browse Source

Fix name collision so auto import works correctly (#4414)

Fix name collision so autocomplete works
Henrik Raitasola 6 years ago
parent
commit
9e97838526
3 changed files with 5 additions and 6 deletions
  1. 1
    1
      lib/src/Navigation.ts
  2. 1
    2
      lib/src/components/Store.ts
  3. 3
    3
      lib/src/index.ts

+ 1
- 1
lib/src/Navigation.ts View File

@@ -17,7 +17,7 @@ import { LayoutRoot, Layout } from './interfaces/Layout';
17 17
 import { Options } from './interfaces/Options';
18 18
 import { ComponentWrapper } from './components/ComponentWrapper';
19 19
 
20
-export class Navigation {
20
+export class NavigationRoot {
21 21
   public readonly Element: React.ComponentType<{ elementId: any; resizeMode?: any; }>;
22 22
   public readonly TouchablePreview: React.ComponentType<any>;
23 23
   public readonly store: Store;

+ 1
- 2
lib/src/components/Store.ts View File

@@ -12,7 +12,6 @@ export class Store {
12 12
     return _.get(this.propsById, componentId, {});
13 13
   }
14 14
 
15
-
16 15
   setComponentClassForName(componentName: string | number, ComponentClass) {
17 16
     _.set(this.componentsByName, componentName.toString(), ComponentClass);
18 17
   }
@@ -20,7 +19,7 @@ export class Store {
20 19
   getComponentClassForName(componentName: string | number) {
21 20
     return _.get(this.componentsByName, componentName.toString());
22 21
   }
23
-  
22
+
24 23
   cleanId(id: string) {
25 24
     _.unset(this.propsById, id);
26 25
   }

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

@@ -1,8 +1,8 @@
1
-import { Navigation as NavigationClass } from './Navigation';
1
+import { NavigationRoot } from './Navigation';
2 2
 
3
-const singleton = new NavigationClass();
3
+const navigationSingleton = new NavigationRoot();
4 4
 
5
-export const Navigation = singleton;
5
+export const Navigation = navigationSingleton;
6 6
 export * from './adapters/Constants';
7 7
 export * from './interfaces/ComponentEvents';
8 8
 export * from './interfaces/Events';