<commit_before>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(mapDispatchToProps)(AppStateContainer)<commit_msg>correct syntax error that was causing dispatch to be null<commit_after>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)
{'fraction_non_alphanumeric': 0.12609170305676856, 'fraction_numerical': 0.0, 'mean_word_length': 5.130434782608695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7570293', 'n_tokens_mistral': 600, 'n_tokens_neox': 566, 'n_words': 107}