import * as React from 'react';
import { Text, View, StyleSheet } from 'react-native';
function AspectView(props) {
const [layout, setLayout] = React.useState(null);
const { aspectRatio = 1, ...inputStyle } =
StyleSheet.flatten(props.style) || {};
const style = [inputStyle, { aspectRatio }];
const { width = 0, height = 0 } = layout;
style.push({ width: height * aspectRatio, height });
style.push({ width, height: width * aspectRatio });
onLayout={({ nativeEvent: { layout } }) => setLayout(layout)}
return <AspectView style={{ width: 48, aspectRatio: 0.75 }} />;