Browse Source

playground bootstrapped to Navigation

Daniel Zlotin 7 years ago
parent
commit
cd0a6c5987
2 changed files with 11 additions and 11 deletions
  1. 4
    4
      playground/ios/playground/AppDelegate.m
  2. 7
    7
      playground/src/app.js

+ 4
- 4
playground/ios/playground/AppDelegate.m View File

@@ -25,11 +25,11 @@
25 25
   // **********************************************
26 26
   // *** DON'T MISS: THIS IS HOW WE BOOTSTRAP *****
27 27
   // **********************************************
28
-  /*self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
28
+  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
29 29
   self.window.backgroundColor = [UIColor whiteColor];
30
-  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];*/
30
+  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation];
31 31
 
32
-  
32
+  /*
33 33
   // original RN bootstrap - remove this part
34 34
   RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
35 35
                                                       moduleName:@"com.example.WelcomeScreen"
@@ -40,7 +40,7 @@
40 40
   rootViewController.view = rootView;
41 41
   self.window.rootViewController = rootViewController;
42 42
   [self.window makeKeyAndVisible];
43
-  
43
+  */
44 44
 
45 45
 
46 46
   return YES;

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

@@ -1,7 +1,7 @@
1 1
 import React, {Component} from 'react';
2 2
 import {AppRegistry, View, Text} from 'react-native';
3 3
 
4
-//import Navigation from 'react-native-navigation';
4
+import Navigation from 'react-native-navigation';
5 5
 
6 6
 const styles = {
7 7
   root: {
@@ -28,11 +28,11 @@ class WelcomeScreen extends Component {
28 28
 }
29 29
 
30 30
 export function start() {
31
-  AppRegistry.registerComponent('com.example.WelcomeScreen', () => WelcomeScreen);
32
-  //Navigation.startApp({
33
-  //  container: {
34
-  //    key: 'com.example.WelcomeScreen'
35
-  //  }
36
-  //});
31
+  Navigation.registerContainer(`com.example.WelcomeScreen`, () => WelcomeScreen);
32
+  Navigation.startApp({
33
+    container: {
34
+      key: 'com.example.WelcomeScreen'
35
+    }
36
+  });
37 37
 }
38 38