import React, {Component} from 'react'; import {ScrollView} from 'react-native'; import _ from 'lodash'; import {Card, Avatar, View, Text} from 'react-native-ui-lib'; class Tab2 extends Component { state = { counter: 0, loading: true }; componentDidMount() { setTimeout(() => { this.setState({loading: false}); }, 1200); /* Uncomment to test TabPage freeze functionality when the page lose focus */ // setInterval(() => { // this.setState({counter: this.state.counter + 1}); // }, 1000); } componentDidUpdate() { /* Uncomment to test TabPage freeze functionality when the page lose focus */ // if (this.state.counter % 3 === 0) { // console.warn('freeze counter', this.state.counter); // } } slow(iterations = 10) { if (iterations === 0) { return; } setTimeout(() => { _.times(5000, () => { console.log('slow log'); }); this.slow(iterations - 1); }, 10); } render() { const {loading} = this.state; return ( Reviews {loading && ( Loading... )} {!loading && _.times(20, index => { return ( {index} ); })} ); } } export default Tab2;