You should initialize state inside the constructor function of your component like this:
export default class MyComponent extends Component {
constructor(props) {
super(props);
this.state = {
myInteger: 0
}
}
render() {
return (
<View>
<Text>Integer: {this.state.myInteger}</Text>
</View>
)
}
}
Using setState one can update the view.