message: Converted to useState and useRef
diff: -import React from 'react';
  +import React, {useState, useRef} from 'react';
  import {StyleSheet, BackHandler, Text, TouchableHighlight, ToolbarAndroid, View, ScrollView} from 'react-native';
  import ViewPager from '@react-native-community/viewpager';
  import Tweets from './Tweets';
  import Notifications from './Notifications';
  -export default class Home extends React.Component {
  - constructor(props, context) {
  +/*constructor(props, context) {
  super(props, context);
  this.state = {page: 0};
  this.handleBack = this.handleBack.bind(this);
  @@ -22,13 +21,12 @@ export default class Home extends React.Component {
  return true;
  }
  return false;
  - }
  - setPage(page) {
  - this.setState({page});
  - this.viewPager.setPage(page);
  - }
  - render() {
  - var {tweets, follows} = this.props;
  +}*/
  +
  +
  +export default ({tweets, follows}) => {
  + const [page, setPage] = useState(0);
  + const viewPager = useRef(null);
  return (
  <View style={{flex: 1}}>
  <ToolbarAndroid title="Home" style={styles.toolbar} />
  @@ -36,20 +34,26 @@ export default class Home extends React.Component {
  <TouchableHighlight
  underlayColor="white"
  style={styles.tab}
  - onPress={() => this.setPage(0)}>
  + onPress={() => {
  + setPage(0);
  + viewPager.current.setPage(0);
  + }}>
  <Text style={styles.text}>Home</Text>
  </TouchableHighlight>
  <TouchableHighlight
  underlayColor="white"
  style={styles.tab}
  - onPress={() => this.setPage(1)}>
  + onPress={() => {
  + setPage(1);
  + viewPager.current.setPage(1);
  + }}>
  <Text style={styles.text}>Notifications</Text>
  </TouchableHighlight>
  </View>
  <ViewPager
  - ref={el => this.viewPager = el}
  + ref={viewPager}
  onPageSelected={({nativeEvent}) => {
  - this.setState({page: nativeEvent.position})
  + setPage(nativeEvent.position)
  }}
  style={{flex: 1}}>
  <View key={1}>
  @@ -65,7 +69,6 @@ export default class Home extends React.Component {
  </ViewPager>
  </View>
  );
  - }
  };
  const styles = StyleSheet.create({
  