-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.ios.js
More file actions
56 lines (51 loc) · 1.19 KB
/
index.ios.js
File metadata and controls
56 lines (51 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
var React = require('react-native');
var ScreenWithMenu = require('./App/Screens/ScreenWithMenu');
var {
AppRegistry,
StyleSheet,
View,
StatusBarIOS,
NavigatorIOS
} = React;
class ReactNativeBug extends React.Component{
constructor(props) {
super(props);
this.state = {
hideNavbar: true
};
}
componentWillMount() {
StatusBarIOS.setHidden(true);
}
shouldComponentUpdate(nextProps, nextState) {
console.log(this.state, nextState); // Object {hideNavbar: true} Object {hideNavbar: false}
return true;
}
toggleNavigation() {
this.setState({
hideNavbar: !this.state.hideNavbar
});
}
render() {
var initialRoute = {
component: ScreenWithMenu,
title: 'Screen',
passProps: {
toggleNavigation: this.toggleNavigation.bind(this)
}
};
return (
<NavigatorIOS
style={styles.container}
initialRoute={initialRoute}
navigationBarHidden={this.state.hideNavbar}
configureScene={() => Navigator.SceneConfigs.PushFromRight} />
);
}
};
var styles = StyleSheet.create({
container: {
flex: 1
}
});
AppRegistry.registerComponent('ReactNativeBug', () => ReactNativeBug);