Daniel Zlotin 6 years ago
parent
commit
636b27e000

+ 2
- 2
integration/redux/MyContainer.js View File

5
 const { connect } = require('react-redux');
5
 const { connect } = require('react-redux');
6
 const store = require('./MyStore');
6
 const store = require('./MyStore');
7
 
7
 
8
-class MyContainer extends Component {
8
+class MyComponent extends Component {
9
   render() {
9
   render() {
10
     if (this.props.renderCountIncrement) {
10
     if (this.props.renderCountIncrement) {
11
       this.props.renderCountIncrement();
11
       this.props.renderCountIncrement();
28
   };
28
   };
29
 }
29
 }
30
 
30
 
31
-module.exports = connect(mapStateToProps)(MyContainer);
31
+module.exports = connect(mapStateToProps)(MyComponent);

+ 5
- 5
integration/redux/Redux.test.js View File

4
 const { Provider } = require('react-redux');
4
 const { Provider } = require('react-redux');
5
 
5
 
6
 describe('redux support', () => {
6
 describe('redux support', () => {
7
-  let MyConnectedContainer;
7
+  let MyConnectedComponent;
8
   let store;
8
   let store;
9
 
9
 
10
   beforeEach(() => {
10
   beforeEach(() => {
11
-    MyConnectedContainer = require('./MyContainer');
11
+    MyConnectedComponent = require('./MyComponent');
12
     store = require('./MyStore');
12
     store = require('./MyStore');
13
   });
13
   });
14
 
14
 
15
   it('renders normally', () => {
15
   it('renders normally', () => {
16
     const tree = renderer.create(
16
     const tree = renderer.create(
17
       <Provider store={store.reduxStore}>
17
       <Provider store={store.reduxStore}>
18
-        <MyConnectedContainer />
18
+        <MyConnectedComponent />
19
       </Provider>
19
       </Provider>
20
     );
20
     );
21
     expect(tree.toJSON().children).toEqual(['no name']);
21
     expect(tree.toJSON().children).toEqual(['no name']);
25
     const renderCountIncrement = jest.fn();
25
     const renderCountIncrement = jest.fn();
26
     const tree = renderer.create(
26
     const tree = renderer.create(
27
       <Provider store={store.reduxStore}>
27
       <Provider store={store.reduxStore}>
28
-        <MyConnectedContainer renderCountIncrement={renderCountIncrement} />
28
+        <MyConnectedComponent renderCountIncrement={renderCountIncrement} />
29
       </Provider>
29
       </Provider>
30
     );
30
     );
31
 
31
 
43
     const renderCountIncrement = jest.fn();
43
     const renderCountIncrement = jest.fn();
44
     const tree = renderer.create(
44
     const tree = renderer.create(
45
       <Provider store={store.reduxStore}>
45
       <Provider store={store.reduxStore}>
46
-        <MyConnectedContainer printAge={true} renderCountIncrement={renderCountIncrement} />
46
+        <MyConnectedComponent printAge={true} renderCountIncrement={renderCountIncrement} />
47
       </Provider>
47
       </Provider>
48
     );
48
     );
49
 
49
 

+ 2
- 2
integration/remx/MyContainer.js View File

5
 const { connect } = require('remx');
5
 const { connect } = require('remx');
6
 const store = require('./MyStore');
6
 const store = require('./MyStore');
7
 
7
 
8
-class MyContainer extends Component {
8
+class MyComponent extends Component {
9
   render() {
9
   render() {
10
     if (this.props.renderCountIncrement) {
10
     if (this.props.renderCountIncrement) {
11
       this.props.renderCountIncrement();
11
       this.props.renderCountIncrement();
28
   };
28
   };
29
 }
29
 }
30
 
30
 
31
-module.exports = connect(mapStateToProps)(MyContainer);
31
+module.exports = connect(mapStateToProps)(MyComponent);

+ 5
- 5
integration/remx/remx.test.js View File

3
 const renderer = require('react-test-renderer');
3
 const renderer = require('react-test-renderer');
4
 
4
 
5
 describe('remx support', () => {
5
 describe('remx support', () => {
6
-  let MyConnectedContainer;
6
+  let MyConnectedComponent;
7
   let store;
7
   let store;
8
 
8
 
9
   beforeEach(() => {
9
   beforeEach(() => {
10
-    MyConnectedContainer = require('./MyContainer');
10
+    MyConnectedComponent = require('./MyComponent');
11
     store = require('./MyStore');
11
     store = require('./MyStore');
12
   });
12
   });
13
 
13
 
14
   it('renders normally', () => {
14
   it('renders normally', () => {
15
-    const tree = renderer.create(<MyConnectedContainer />);
15
+    const tree = renderer.create(<MyConnectedComponent />);
16
     expect(tree.toJSON().children).toEqual(['no name']);
16
     expect(tree.toJSON().children).toEqual(['no name']);
17
   });
17
   });
18
 
18
 
19
   it('rerenders as a result of an underlying state change (by selector)', () => {
19
   it('rerenders as a result of an underlying state change (by selector)', () => {
20
     const renderCountIncrement = jest.fn();
20
     const renderCountIncrement = jest.fn();
21
-    const tree = renderer.create(<MyConnectedContainer renderCountIncrement={renderCountIncrement} />);
21
+    const tree = renderer.create(<MyConnectedComponent renderCountIncrement={renderCountIncrement} />);
22
 
22
 
23
     expect(tree.toJSON().children).toEqual(['no name']);
23
     expect(tree.toJSON().children).toEqual(['no name']);
24
     expect(renderCountIncrement).toHaveBeenCalledTimes(1);
24
     expect(renderCountIncrement).toHaveBeenCalledTimes(1);
32
 
32
 
33
   it('rerenders as a result of an underlying state change with a new key', () => {
33
   it('rerenders as a result of an underlying state change with a new key', () => {
34
     const renderCountIncrement = jest.fn();
34
     const renderCountIncrement = jest.fn();
35
-    const tree = renderer.create(<MyConnectedContainer printAge={true} renderCountIncrement={renderCountIncrement} />);
35
+    const tree = renderer.create(<MyConnectedComponent printAge={true} renderCountIncrement={renderCountIncrement} />);
36
 
36
 
37
     expect(tree.toJSON().children).toEqual(null);
37
     expect(tree.toJSON().children).toEqual(null);
38
     expect(renderCountIncrement).toHaveBeenCalledTimes(1);
38
     expect(renderCountIncrement).toHaveBeenCalledTimes(1);

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

1
 const Navigation = require('react-native-navigation');
1
 const Navigation = require('react-native-navigation');
2
-const { registerContainers } = require('./containers');
2
+const { registerComponents } = require('./components');
3
 
3
 
4
 function start() {
4
 function start() {
5
-  registerContainers();
5
+  registerComponents();
6
   Navigation.events().onAppLaunched(() => {
6
   Navigation.events().onAppLaunched(() => {
7
     Navigation.setRoot({
7
     Navigation.setRoot({
8
       stack: {
8
       stack: {

+ 2
- 2
playground/src/containers/CustomTransitionDestination.js View File

21
     };
21
     };
22
   }
22
   }
23
   push() {
23
   push() {
24
-    Navigation.push(this.props.containerId, {
24
+    Navigation.push(this.props.componentId, {
25
       component: {
25
       component: {
26
         name: 'navigation.playground.OptionsScreen'
26
         name: 'navigation.playground.OptionsScreen'
27
       }
27
       }
28
     });
28
     });
29
   }
29
   }
30
   pop() {
30
   pop() {
31
-    Navigation.pop(this.props.containerId, {
31
+    Navigation.pop(this.props.componentId, {
32
       customTransition: {
32
       customTransition: {
33
         animations: [{ type: 'sharedElement', fromId: 'title2', toId: 'title1', startDelay: 0, springVelocity: 0.2, duration: 0.5 },
33
         animations: [{ type: 'sharedElement', fromId: 'title2', toId: 'title1', startDelay: 0, springVelocity: 0.2, duration: 0.5 },
34
         { type: 'sharedElement', toId: 'image1', fromId: 'customDestinationImage', startDelay: 0, springVelocity: 0.2, duration: 0.5 },
34
         { type: 'sharedElement', toId: 'image1', fromId: 'customDestinationImage', startDelay: 0, springVelocity: 0.2, duration: 0.5 },

+ 2
- 2
playground/src/containers/LifecycleScreen.js View File

55
         <Text style={styles.h1}>{`Lifecycle Screen`}</Text>
55
         <Text style={styles.h1}>{`Lifecycle Screen`}</Text>
56
         <Text style={styles.h1}>{this.state.text}</Text>
56
         <Text style={styles.h1}>{this.state.text}</Text>
57
         <Button title="Push to test didDisappear" testID={testIDs.PUSH_TO_TEST_DID_DISAPPEAR_BUTTON} onPress={this.onClickPush} />
57
         <Button title="Push to test didDisappear" testID={testIDs.PUSH_TO_TEST_DID_DISAPPEAR_BUTTON} onPress={this.onClickPush} />
58
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
58
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
59
       </View>
59
       </View>
60
     );
60
     );
61
   }
61
   }
62
 
62
 
63
   onClickPush() {
63
   onClickPush() {
64
-    Navigation.push(this.props.containerId, { component: { name: 'navigation.playground.TextScreen' } });
64
+    Navigation.push(this.props.componentId, { component: { name: 'navigation.playground.TextScreen' } });
65
   }
65
   }
66
 }
66
 }
67
 module.exports = LifecycleScreen;
67
 module.exports = LifecycleScreen;

+ 11
- 11
playground/src/containers/OptionsScreen.js View File

63
         <Button title="Custom Transition" onPress={this.onClickCustomTranstition} />
63
         <Button title="Custom Transition" onPress={this.onClickCustomTranstition} />
64
         <Button title="Show custom alert" testID={testIDs.SHOW_CUSTOM_ALERT_BUTTON} onPress={this.onClickAlert} />
64
         <Button title="Show custom alert" testID={testIDs.SHOW_CUSTOM_ALERT_BUTTON} onPress={this.onClickAlert} />
65
         <Button title="Show snackbar" testID={testIDs.SHOW_SNACKBAR_BUTTON} onPress={this.onClickSnackbar} />
65
         <Button title="Show snackbar" testID={testIDs.SHOW_SNACKBAR_BUTTON} onPress={this.onClickSnackbar} />
66
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
66
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
67
       </View>
67
       </View>
68
     );
68
     );
69
   }
69
   }
70
 
70
 
71
   onNavigationButtonPressed(id) {
71
   onNavigationButtonPressed(id) {
72
     if (id === BUTTON_ONE) {
72
     if (id === BUTTON_ONE) {
73
-      Navigation.setOptions(this.props.containerId, {
73
+      Navigation.setOptions(this.props.componentId, {
74
         topBar: {
74
         topBar: {
75
           rightButtons: [{
75
           rightButtons: [{
76
             id: BUTTON_TWO,
76
             id: BUTTON_TWO,
88
         }
88
         }
89
       });
89
       });
90
     } else if (id === BUTTON_TWO) {
90
     } else if (id === BUTTON_TWO) {
91
-      Navigation.setOptions(this.props.containerId, {
91
+      Navigation.setOptions(this.props.componentId, {
92
         topBar: {
92
         topBar: {
93
           rightButtons: [{
93
           rightButtons: [{
94
             id: BUTTON_ONE,
94
             id: BUTTON_ONE,
106
         }
106
         }
107
       });
107
       });
108
     } else if (id === BUTTON_LEFT) {
108
     } else if (id === BUTTON_LEFT) {
109
-      Navigation.pop(this.props.containerId);
109
+      Navigation.pop(this.props.componentId);
110
     }
110
     }
111
   }
111
   }
112
 
112
 
113
   onClickDynamicOptions() {
113
   onClickDynamicOptions() {
114
-    Navigation.setOptions(this.props.containerId, {
114
+    Navigation.setOptions(this.props.componentId, {
115
       topBar: {
115
       topBar: {
116
         title: 'Dynamic Title',
116
         title: 'Dynamic Title',
117
         textColor: '#00FFFF',
117
         textColor: '#00FFFF',
124
   }
124
   }
125
 
125
 
126
   onClickScrollViewScreen() {
126
   onClickScrollViewScreen() {
127
-    Navigation.push(this.props.containerId, {
127
+    Navigation.push(this.props.componentId, {
128
       component: {
128
       component: {
129
         name: 'navigation.playground.ScrollViewScreen'
129
         name: 'navigation.playground.ScrollViewScreen'
130
       }
130
       }
132
   }
132
   }
133
 
133
 
134
   onClickCustomTranstition() {
134
   onClickCustomTranstition() {
135
-    Navigation.push(this.props.containerId, {
135
+    Navigation.push(this.props.componentId, {
136
       component: {
136
       component: {
137
         name: 'navigation.playground.CustomTransitionOrigin'
137
         name: 'navigation.playground.CustomTransitionOrigin'
138
       }
138
       }
140
   }
140
   }
141
 
141
 
142
   onClickTopBarTransparent() {
142
   onClickTopBarTransparent() {
143
-    Navigation.setOptions(this.props.containerId, {
143
+    Navigation.setOptions(this.props.componentId, {
144
       topBar: {
144
       topBar: {
145
         transparent: true
145
         transparent: true
146
       }
146
       }
147
     });
147
     });
148
   }
148
   }
149
   onClickTopBarOpaque() {
149
   onClickTopBarOpaque() {
150
-    Navigation.setOptions(this.props.containerId, {
150
+    Navigation.setOptions(this.props.componentId, {
151
       topBar: {
151
       topBar: {
152
         transparent: false
152
         transparent: false
153
       }
153
       }
154
     });
154
     });
155
   }
155
   }
156
   onClickShowTopBar() {
156
   onClickShowTopBar() {
157
-    Navigation.setOptions(this.props.containerId, {
157
+    Navigation.setOptions(this.props.componentId, {
158
       topBar: {
158
       topBar: {
159
         hidden: false,
159
         hidden: false,
160
         animateHide: true
160
         animateHide: true
163
   }
163
   }
164
 
164
 
165
   onClickHideTopBar() {
165
   onClickHideTopBar() {
166
-    Navigation.setOptions(this.props.containerId, {
166
+    Navigation.setOptions(this.props.componentId, {
167
       topBar: {
167
       topBar: {
168
         hidden: true,
168
         hidden: true,
169
         animateHide: true
169
         animateHide: true

+ 3
- 3
playground/src/containers/OrientationDetectScreen.js View File

12
 
12
 
13
     this.detectHorizontal = this.detectHorizontal.bind(this);
13
     this.detectHorizontal = this.detectHorizontal.bind(this);
14
     this.state = { horizontal: false };
14
     this.state = { horizontal: false };
15
-    Navigation.setOptions(this.props.containerId, {
15
+    Navigation.setOptions(this.props.componentId, {
16
       orientation: props.orientation
16
       orientation: props.orientation
17
     });
17
     });
18
   }
18
   }
21
     return (
21
     return (
22
       <View style={styles.root} onLayout={this.detectHorizontal}>
22
       <View style={styles.root} onLayout={this.detectHorizontal}>
23
         <Text style={styles.h1}>{`Orientation Screen`}</Text>
23
         <Text style={styles.h1}>{`Orientation Screen`}</Text>
24
-        <Button title="Dismiss" testID={testIDs.DISMISS_BUTTON} onPress={() => Navigation.dismissModal(this.props.containerId)} />
25
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
24
+        <Button title="Dismiss" testID={testIDs.DISMISS_BUTTON} onPress={() => Navigation.dismissModal(this.props.componentId)} />
25
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
26
         <Text style={styles.footer} testID="currentOrientation">{this.state.horizontal ? 'Landscape' : 'Portrait'}</Text>
26
         <Text style={styles.footer} testID="currentOrientation">{this.state.horizontal ? 'Landscape' : 'Portrait'}</Text>
27
       </View>
27
       </View>
28
     );
28
     );

+ 5
- 5
playground/src/containers/PushedScreen.js View File

29
         <Button title="Pop Previous" testID={testIDs.POP_PREVIOUS_BUTTON} onPress={this.onClickPopPrevious} />
29
         <Button title="Pop Previous" testID={testIDs.POP_PREVIOUS_BUTTON} onPress={this.onClickPopPrevious} />
30
         <Button title="Pop To Root" testID={testIDs.POP_TO_ROOT} onPress={this.onClickPopToRoot} />
30
         <Button title="Pop To Root" testID={testIDs.POP_TO_ROOT} onPress={this.onClickPopToRoot} />
31
         {stackPosition > 2 && <Button title="Pop To Stack Position 1" testID={testIDs.POP_STACK_POSITION_ONE_BUTTON} onPress={this.onClickPopToFirstPosition} />}
31
         {stackPosition > 2 && <Button title="Pop To Stack Position 1" testID={testIDs.POP_STACK_POSITION_ONE_BUTTON} onPress={this.onClickPopToFirstPosition} />}
32
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
32
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
33
       </View>
33
       </View>
34
     );
34
     );
35
   }
35
   }
36
 
36
 
37
   async onClickPush() {
37
   async onClickPush() {
38
-    await Navigation.push(this.props.containerId, {
38
+    await Navigation.push(this.props.componentId, {
39
       name: 'navigation.playground.PushedScreen',
39
       name: 'navigation.playground.PushedScreen',
40
       passProps: {
40
       passProps: {
41
         stackPosition: this.getStackPosition() + 1,
41
         stackPosition: this.getStackPosition() + 1,
42
-        previousScreenIds: _.concat([], this.props.previousScreenIds || [], this.props.containerId)
42
+        previousScreenIds: _.concat([], this.props.previousScreenIds || [], this.props.componentId)
43
       }
43
       }
44
     });
44
     });
45
   }
45
   }
46
 
46
 
47
   async onClickPop() {
47
   async onClickPop() {
48
-    await Navigation.pop(this.props.containerId);
48
+    await Navigation.pop(this.props.componentId);
49
   }
49
   }
50
 
50
 
51
   async onClickPopPrevious() {
51
   async onClickPopPrevious() {
57
   }
57
   }
58
 
58
 
59
   async onClickPopToRoot() {
59
   async onClickPopToRoot() {
60
-    await Navigation.popToRoot(this.props.containerId);
60
+    await Navigation.popToRoot(this.props.componentId);
61
   }
61
   }
62
 
62
 
63
   getStackPosition() {
63
   getStackPosition() {

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

36
   }
36
   }
37
 
37
 
38
   onClickToggleTopBarHideOnScroll() {
38
   onClickToggleTopBarHideOnScroll() {
39
-    Navigation.setOptions(this.props.containerId, {
39
+    Navigation.setOptions(this.props.componentId, {
40
       topBar: {
40
       topBar: {
41
         hideOnScroll: !this.state.topBarHideOnScroll
41
         hideOnScroll: !this.state.topBarHideOnScroll
42
       }
42
       }

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

20
   }
20
   }
21
 
21
 
22
   hideSideMenu() {
22
   hideSideMenu() {
23
-    Navigation.setOptions(this.props.containerId, {
23
+    Navigation.setOptions(this.props.componentId, {
24
       sideMenu: {
24
       sideMenu: {
25
         [this.props.side]: {
25
         [this.props.side]: {
26
           visible: false
26
           visible: false

+ 11
- 11
playground/src/containers/TextScreen.js View File

6
 const Navigation = require('react-native-navigation');
6
 const Navigation = require('react-native-navigation');
7
 const testIDs = require('../testIDs');
7
 const testIDs = require('../testIDs');
8
 
8
 
9
-let globalFirstContainerID;
9
+let globalFirstComponentID;
10
 
10
 
11
 class TextScreen extends Component {
11
 class TextScreen extends Component {
12
   static get options() {
12
   static get options() {
19
 
19
 
20
   constructor(props) {
20
   constructor(props) {
21
     super(props);
21
     super(props);
22
-    globalFirstContainerID = (props.text === 'This is tab 1') ? props.containerId : globalFirstContainerID;
22
+    globalFirstComponentID = (props.text === 'This is tab 1') ? props.componentId : globalFirstComponentID;
23
   }
23
   }
24
 
24
 
25
   render() {
25
   render() {
27
       <View style={styles.root}>
27
       <View style={styles.root}>
28
         <Text style={styles.h1} testID={testIDs.CENTERED_TEXT_HEADER}>{this.props.text || 'Text Screen'}</Text>
28
         <Text style={styles.h1} testID={testIDs.CENTERED_TEXT_HEADER}>{this.props.text || 'Text Screen'}</Text>
29
         {this.renderTextFromFunctionInProps()}
29
         {this.renderTextFromFunctionInProps()}
30
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
30
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
31
         <Button title={'Set Tab Badge'} testID={testIDs.SET_TAB_BADGE_BUTTON} onPress={() => this.onButtonPress()} />
31
         <Button title={'Set Tab Badge'} testID={testIDs.SET_TAB_BADGE_BUTTON} onPress={() => this.onButtonPress()} />
32
         <Button title={'Switch To Tab 2'} testID={testIDs.SWITCH_SECOND_TAB_BUTTON} onPress={() => this.onClickSwitchToTab()} />
32
         <Button title={'Switch To Tab 2'} testID={testIDs.SWITCH_SECOND_TAB_BUTTON} onPress={() => this.onClickSwitchToTab()} />
33
-        <Button title={'Switch To Tab 1 by containerID'} testID={testIDs.SWITCH_FIRST_TAB_BUTTON} onPress={() => this.onClickSwitchToTabByContainerID()} />
33
+        <Button title={'Switch To Tab 1 by componentID'} testID={testIDs.SWITCH_FIRST_TAB_BUTTON} onPress={() => this.onClickSwitchToTabByComponentID()} />
34
         <Button title="Hide Tab Bar" testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(true)} />
34
         <Button title="Hide Tab Bar" testID={testIDs.HIDE_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(true)} />
35
         <Button title="Show Tab Bar" testID={testIDs.SHOW_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
35
         <Button title="Show Tab Bar" testID={testIDs.SHOW_BOTTOM_TABS_BUTTON} onPress={() => this.hideTabBar(false)} />
36
         <Button title="Show Left Side Menu" testID={testIDs.SHOW_LEFT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('left')} />
36
         <Button title="Show Left Side Menu" testID={testIDs.SHOW_LEFT_SIDE_MENU_BUTTON} onPress={() => this.showSideMenu('left')} />
49
   }
49
   }
50
 
50
 
51
   onButtonPress() {
51
   onButtonPress() {
52
-    Navigation.setOptions(this.props.containerId, {
52
+    Navigation.setOptions(this.props.componentId, {
53
       bottomTab: {
53
       bottomTab: {
54
         badge: `TeSt`
54
         badge: `TeSt`
55
       }
55
       }
57
   }
57
   }
58
 
58
 
59
   onClickSwitchToTab() {
59
   onClickSwitchToTab() {
60
-    Navigation.setOptions(this.props.containerId, {
60
+    Navigation.setOptions(this.props.componentId, {
61
       bottomTabs: {
61
       bottomTabs: {
62
         currentTabIndex: 1,
62
         currentTabIndex: 1,
63
         hidden: true,
63
         hidden: true,
66
     });
66
     });
67
   }
67
   }
68
 
68
 
69
-  onClickSwitchToTabByContainerID() {
70
-    Navigation.setOptions(this.props.containerId, {
69
+  onClickSwitchToTabByComponentID() {
70
+    Navigation.setOptions(this.props.componentId, {
71
       bottomTabs: {
71
       bottomTabs: {
72
-        currentTabId: globalFirstContainerID
72
+        currentTabId: globalFirstComponentID
73
       }
73
       }
74
     });
74
     });
75
   }
75
   }
76
 
76
 
77
   hideTabBar(hidden) {
77
   hideTabBar(hidden) {
78
-    Navigation.setOptions(this.props.containerId, {
78
+    Navigation.setOptions(this.props.componentId, {
79
       bottomTabs: {
79
       bottomTabs: {
80
         hidden
80
         hidden
81
       }
81
       }
83
   }
83
   }
84
 
84
 
85
   showSideMenu(side) {
85
   showSideMenu(side) {
86
-    Navigation.setOptions(this.props.containerId, {
86
+    Navigation.setOptions(this.props.componentId, {
87
       sideMenu: {
87
       sideMenu: {
88
         [side]: {
88
         [side]: {
89
           visible: true
89
           visible: true

+ 2
- 2
playground/src/containers/TopTabOptionsScreen.js View File

25
     return (
25
     return (
26
       <View style={styles.root}>
26
       <View style={styles.root}>
27
         <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
27
         <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
28
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
28
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
29
         <Button title="Dynamic Options" testID={testIDs.DYNAMIC_OPTIONS_BUTTON} onPress={this.onClickDynamicOptions} />
29
         <Button title="Dynamic Options" testID={testIDs.DYNAMIC_OPTIONS_BUTTON} onPress={this.onClickDynamicOptions} />
30
       </View>
30
       </View>
31
     );
31
     );
32
   }
32
   }
33
 
33
 
34
   onClickDynamicOptions() {
34
   onClickDynamicOptions() {
35
-    Navigation.setOptions(this.props.containerId, {
35
+    Navigation.setOptions(this.props.componentId, {
36
       topBar: {
36
       topBar: {
37
         title: 'Dynamic Title',
37
         title: 'Dynamic Title',
38
         textColor: '#00FFFF',
38
         textColor: '#00FFFF',

+ 2
- 2
playground/src/containers/TopTabScreen.js View File

16
 
16
 
17
   constructor(props) {
17
   constructor(props) {
18
     super(props);
18
     super(props);
19
-    Navigation.setOptions(this.props.containerId, {
19
+    Navigation.setOptions(this.props.componentId, {
20
       topBar: {
20
       topBar: {
21
         title: this.props.title
21
         title: this.props.title
22
       }
22
       }
27
     return (
27
     return (
28
       <View style={styles.root}>
28
       <View style={styles.root}>
29
         <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
29
         <Text style={styles.h1}>{this.props.text || 'Top Tab Screen'}</Text>
30
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
30
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
31
       </View>
31
       </View>
32
     );
32
     );
33
   }
33
   }

+ 7
- 7
playground/src/containers/WelcomeScreen.js View File

39
         <Button title="Show Modal" testID={testIDs.SHOW_MODAL_BUTTON} onPress={this.onClickShowModal} />
39
         <Button title="Show Modal" testID={testIDs.SHOW_MODAL_BUTTON} onPress={this.onClickShowModal} />
40
         <Button title="Show Redbox" testID={testIDs.SHOW_REDBOX_BUTTON} onPress={this.onClickShowRedbox} />
40
         <Button title="Show Redbox" testID={testIDs.SHOW_REDBOX_BUTTON} onPress={this.onClickShowRedbox} />
41
         <Button title="Orientation" testID={testIDs.ORIENTATION_BUTTON} onPress={this.onClickPushOrientationMenuScreen} />
41
         <Button title="Orientation" testID={testIDs.ORIENTATION_BUTTON} onPress={this.onClickPushOrientationMenuScreen} />
42
-        <Text style={styles.footer}>{`this.props.containerId = ${this.props.containerId}`}</Text>
42
+        <Text style={styles.footer}>{`this.props.componentId = ${this.props.componentId}`}</Text>
43
       </View>
43
       </View>
44
     );
44
     );
45
   }
45
   }
164
   }
164
   }
165
 
165
 
166
   async onClickPush() {
166
   async onClickPush() {
167
-    await Navigation.push(this.props.containerId, {
167
+    await Navigation.push(this.props.componentId, {
168
       component: {
168
       component: {
169
         name: 'navigation.playground.PushedScreen'
169
         name: 'navigation.playground.PushedScreen'
170
       }
170
       }
172
   }
172
   }
173
 
173
 
174
   onClickLifecycleScreen() {
174
   onClickLifecycleScreen() {
175
-    Navigation.push(this.props.containerId, {
175
+    Navigation.push(this.props.componentId, {
176
       component: {
176
       component: {
177
         name: 'navigation.playground.LifecycleScreen'
177
         name: 'navigation.playground.LifecycleScreen'
178
       }
178
       }
192
   }
192
   }
193
 
193
 
194
   onClickPushOptionsScreen() {
194
   onClickPushOptionsScreen() {
195
-    Navigation.push(this.props.containerId, {
195
+    Navigation.push(this.props.componentId, {
196
       component: {
196
       component: {
197
         name: 'navigation.playground.OptionsScreen'
197
         name: 'navigation.playground.OptionsScreen'
198
       }
198
       }
200
   }
200
   }
201
 
201
 
202
   onClickPushTopTabsScreen() {
202
   onClickPushTopTabsScreen() {
203
-    Navigation.push(this.props.containerId, {
203
+    Navigation.push(this.props.componentId, {
204
       topTabs: [
204
       topTabs: [
205
         {
205
         {
206
           name: 'navigation.playground.TopTabOptionsScreen',
206
           name: 'navigation.playground.TopTabOptionsScreen',
251
   }
251
   }
252
 
252
 
253
   onClickBackHandler() {
253
   onClickBackHandler() {
254
-    Navigation.push(this.props.containerId, {
254
+    Navigation.push(this.props.componentId, {
255
       component: {
255
       component: {
256
         name: 'navigation.playground.BackHandlerScreen'
256
         name: 'navigation.playground.BackHandlerScreen'
257
       }
257
       }
259
   }
259
   }
260
 
260
 
261
   onClickPushOrientationMenuScreen() {
261
   onClickPushOrientationMenuScreen() {
262
-    Navigation.push(this.props.containerId, {
262
+    Navigation.push(this.props.componentId, {
263
       component: {
263
       component: {
264
         name: 'navigation.playground.OrientationSelectScreen'
264
         name: 'navigation.playground.OrientationSelectScreen'
265
       }
265
       }

+ 18
- 18
playground/src/containers/index.js View File

16
 const TopTabScreen = require('./TopTabScreen');
16
 const TopTabScreen = require('./TopTabScreen');
17
 const TopTabOptionsScreen = require('./TopTabOptionsScreen');
17
 const TopTabOptionsScreen = require('./TopTabOptionsScreen');
18
 
18
 
19
-function registerContainers() {
20
-  Navigation.registerContainer(`navigation.playground.CustomTransitionDestination`, () => CustomTransitionDestination);
21
-  Navigation.registerContainer(`navigation.playground.CustomTransitionOrigin`, () => CustomTransitionOrigin);
22
-  Navigation.registerContainer(`navigation.playground.ScrollViewScreen`, () => ScrollViewScreen);
23
-  Navigation.registerContainer(`navigation.playground.WelcomeScreen`, () => WelcomeScreen);
24
-  Navigation.registerContainer(`navigation.playground.ModalScreen`, () => ModalScreen);
25
-  Navigation.registerContainer(`navigation.playground.LifecycleScreen`, () => LifecycleScreen);
26
-  Navigation.registerContainer(`navigation.playground.TextScreen`, () => TextScreen);
27
-  Navigation.registerContainer(`navigation.playground.PushedScreen`, () => PushedScreen);
28
-  Navigation.registerContainer(`navigation.playground.OptionsScreen`, () => OptionsScreen);
29
-  Navigation.registerContainer(`navigation.playground.OrientationSelectScreen`, () => OrientationSelectScreen);
30
-  Navigation.registerContainer(`navigation.playground.OrientationDetectScreen`, () => OrientationDetectScreen);
31
-  Navigation.registerContainer('navigation.playground.CustomDialog', () => CustomDialog);
32
-  Navigation.registerContainer('navigation.playground.BackHandlerScreen', () => BandHandlerScreen);
33
-  Navigation.registerContainer('navigation.playground.SideMenuScreen', () => SideMenuScreen);
34
-  Navigation.registerContainer('navigation.playground.TopTabScreen', () => TopTabScreen);
35
-  Navigation.registerContainer('navigation.playground.TopTabOptionsScreen', () => TopTabOptionsScreen);
19
+function registerComponents() {
20
+  Navigation.registerComponent(`navigation.playground.CustomTransitionDestination`, () => CustomTransitionDestination);
21
+  Navigation.registerComponent(`navigation.playground.CustomTransitionOrigin`, () => CustomTransitionOrigin);
22
+  Navigation.registerComponent(`navigation.playground.ScrollViewScreen`, () => ScrollViewScreen);
23
+  Navigation.registerComponent(`navigation.playground.WelcomeScreen`, () => WelcomeScreen);
24
+  Navigation.registerComponent(`navigation.playground.ModalScreen`, () => ModalScreen);
25
+  Navigation.registerComponent(`navigation.playground.LifecycleScreen`, () => LifecycleScreen);
26
+  Navigation.registerComponent(`navigation.playground.TextScreen`, () => TextScreen);
27
+  Navigation.registerComponent(`navigation.playground.PushedScreen`, () => PushedScreen);
28
+  Navigation.registerComponent(`navigation.playground.OptionsScreen`, () => OptionsScreen);
29
+  Navigation.registerComponent(`navigation.playground.OrientationSelectScreen`, () => OrientationSelectScreen);
30
+  Navigation.registerComponent(`navigation.playground.OrientationDetectScreen`, () => OrientationDetectScreen);
31
+  Navigation.registerComponent('navigation.playground.CustomDialog', () => CustomDialog);
32
+  Navigation.registerComponent('navigation.playground.BackHandlerScreen', () => BandHandlerScreen);
33
+  Navigation.registerComponent('navigation.playground.SideMenuScreen', () => SideMenuScreen);
34
+  Navigation.registerComponent('navigation.playground.TopTabScreen', () => TopTabScreen);
35
+  Navigation.registerComponent('navigation.playground.TopTabOptionsScreen', () => TopTabOptionsScreen);
36
 }
36
 }
37
 
37
 
38
 module.exports = {
38
 module.exports = {
39
-  registerContainers
39
+  registerComponents
40
 };
40
 };

+ 1
- 1
scripts/generate-js-doc.js View File

4
 
4
 
5
 const BASE_DIR = './lib/src/params/';
5
 const BASE_DIR = './lib/src/params/';
6
 const OPTIONS_DIR = BASE_DIR + 'options/';
6
 const OPTIONS_DIR = BASE_DIR + 'options/';
7
-const CONTAINERS_DIR = BASE_DIR + 'containers/';
7
+const CONTAINERS_DIR = BASE_DIR + 'components/';
8
 const OUTPUT_DIR = './docs/docs/';
8
 const OUTPUT_DIR = './docs/docs/';
9
 const PARAMS_PARTIALS = ['./docs/templates/header.hbs', './docs/templates/sig-name.hbs'];
9
 const PARAMS_PARTIALS = ['./docs/templates/header.hbs', './docs/templates/sig-name.hbs'];
10
 const PARTIALS = [
10
 const PARTIALS = [