Skip to content

Instantly share code, notes, and snippets.

@brunodasilvalenga
Created February 21, 2017 18:36
Show Gist options
  • Save brunodasilvalenga/bd7d7efb4f2f63b7aeaaad1243f141ce to your computer and use it in GitHub Desktop.
Save brunodasilvalenga/bd7d7efb4f2f63b7aeaaad1243f141ce to your computer and use it in GitHub Desktop.
import React, { Component } from 'react'
import {
Container,
Header,
Title,
Content,
Text,
Button,
Icon,
Left,
Right,
Body,
List,
ListItem
} from 'native-base'
import NavBar from '../components/NavBar'
export default class HomeScreen extends Component {
constructor(props) {
super(props)
console.log('home', this.props)
}
_setParentState(args){
this.props.setParentState(args)
}
componentWillMount () {
this._setParentState({'drawerDisabled': false})
}
componentWillReceiveProps(nextProps) {
console.log('home - next props', nextProps)
}
render() {
return (
<Container>
<NavBar route={this.props.route} navigator={this.props.navigator} emitter={this.props.emitter} />
<Content>
<Button onPress={() => this.props.navigator.push({id: 'client'})}>
<Text>Go to Client</Text>
</Button>
<Button onPress={() => this._setParentState({'drawerDisabled': false})}>
<Text>Active Drawer</Text>
</Button>
</Content>
</Container>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment