import React, {Component} from 'react'; import { StyleSheet, SafeAreaView, Text, TouchableOpacity, View, Keyboard, Button, Platform, } from 'react-native'; import Alerts from './examples/Alerts'; import Scrolling from './examples/Scrolling'; import Background from './examples/Background'; import Uploads from './examples/Uploads'; const TESTS = { Alerts: { title: 'Alerts', testId: 'alerts', description: 'Alerts tests', render() { return ; }, }, Scrolling: { title: 'Scrolling', testId: 'scrolling', description: 'Scrolling event test', render() { return ; }, }, Background: { title: 'Background', testId: 'background', description: 'Background color test', render() { return ; }, }, Uploads: { title: 'Uploads', testId: 'uploads', description: 'Upload test', render() { return ; }, }, }; type Props = {}; type State = {restarting: boolean, currentTest: Object}; export default class App extends Component { state = { restarting: false, currentTest: TESTS.Alerts, }; _simulateRestart = () => { this.setState({restarting: true}, () => this.setState({restarting: false})); }; _changeTest = testName => { this.setState({currentTest: TESTS[testName]}); }; render() { const {restarting, currentTest} = this.state; return ( Keyboard.dismiss()} testID="closeKeyboard" /> Simulate Restart