import React from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { Util } from 'expo'
export default class App extends React.Component {
state = {
updated: false,
}
componentWillMount() {
Util.addNewVersionListenerExperimental(() => {
this.setState({ updated: true })
setTimeout(() => Util.reload(), 10000)
})
}
render() {
if (this.state.updated) {
return (
App update available, reloading in 10 seconds...
)
}
return (
App is running...
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
justifyContent: 'center',
},
});