@vandrei977/react-native-render-html
Version:
The hackable, full-featured Open Source HTML rendering solution for React Native.
11 lines (10 loc) • 308 B
text/typescript
export default function getDimensionsWithAspectRatio(
width: number | null,
height: number | null,
aspectRatio: number | undefined
) {
return {
width: width ?? (aspectRatio && height ? height * aspectRatio : null),
height: height ?? (aspectRatio && width ? width / aspectRatio : null)
};
}