dimension.js in react native code example
Example 1: dimensions react native
import { Dimensions } from 'react-native';
console.log({
width: Dimensions.get('window').width,
height: Dimensions.get('window').height
})
Example 2: responsive calc height react native
import React from "react";import { View } from "react-native";import { useResponsiveHeight, useResponsiveWidth} from "react-native-responsive-dimensions"; const App = () => { const height = useResponsiveHeight(25); const width = useResponsiveWidth(25); return <View style={{ height, width }} />;};