Skip to content

Latest commit

 

History

History
29 lines (22 loc) · 612 Bytes

dimensions.md

File metadata and controls

29 lines (22 loc) · 612 Bytes

Dimensions 📐

Nothing special just two helper functions that use Dimensions API

  • getWindowDimensions
  • getScreenDimensions

These functions return an object with the next properties:

width: number;
height: number;
scale: number;
fontScale: number;

Example:

import { makeUseStyles } from "react-native-stylex";
import { getWindowDimensions } from "react-native-stylex/dimensions";

export const useStyles = makeUseStyles(() => ({
  video: {
    width: getWindowDimensions().width,
    height: getWindowDimensions().width,
  },
}));