import React from 'react'; import { ScrollView, View, Text, Button, Platform } from 'react-native'; import * as Device from 'expo-device'; import HeadingText from '../components/HeadingText'; import MonoText from '../components/MonoText'; interface DeviceConstant { name?: string; value?: any; } interface DeviceMethod { name?: string; method?: any; } interface State { value?: any; } class DeviceConstants extends React.Component { render() { let { name, value } = this.props; if (typeof value === 'boolean') { return ( {name} {String(value)} ); } else { return ( {name} {value} ); } } } class DeviceMethods extends React.Component { state = { value: '', }; _getValue = async () => { let method = this.props.method; let value = await method(); if (typeof value === 'boolean') { value = value.toString(); } else if (Array.isArray(value)) { value = value.join('\n'); } this.setState({ value }); }; render() { let { name } = this.props; if(!name) name = ''; return ( {name} {this.state.value}