import React from 'react'
import { AppState } from 'react-native'
import { connect } from 'react-redux'

class AppStateContainer extends React.Component {
	state = {
		appState: AppState.currentState
	}

	async componentDidMount() {
		AppState.addEventListener('change', this._handleAppStateChange)
	}

	componentWillUnmount() {
		AppState.removeEventListener('change', this._handleAppStateChange)
	}

	_handleAppStateChange = (nextAppState) => {
		if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') {
			this.props.updateStudentProfile()
		}
		this.setState({ appState: nextAppState })
	}

	render() {
		return null
	}
}

const mapDispatchToProps = (dispatch, ownProps) => (
	{
		updateStudentProfile: () => {
			dispatch({ type: 'UPDATE_STUDENT_PROFILE' })
		}
	}
)

module.exports = connect(null ,mapDispatchToProps)(AppStateContainer)

@@ -628,16 +628,52 @@
 der() %7B%0A
+%09%09this.props.updateStudentProfile()%0A
 %09%09return
@@ -863,10 +863,10 @@
 null
- 
 ,
+ 
 mapD

Add fetch for student id data on initial load