Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@rnhooks/dimensions

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rnhooks/dimensions

React Native hook for Dimensions

latest
Source
npmnpm
Version
0.0.3
Version published
Maintainers
2
Created
Source

@rnhooks/dimensions Build Status Maintainability module formats: umd, cjs, esm

React Native hook for Dimensions

Installation

$ yarn add @rnhooks/dimensions

Usage

import useDimensions from '@rnhooks/dimensions';

function App() {
  const { fontScale, width, height, scale } = useDimensions('window');

  return (
    <View style={styles.container}>
      <Text style={styles.type}>{`Width: ${width}`}</Text>
      <Text style={styles.type}>{`Height: ${height}`}</Text>
      <Text style={styles.type}>{`Font Scale: ${fontScale}, Scale: ${scale}`}</Text>
    </View>
  );
}

Input

NameDefaultTypeDescription
window / screennullstringType window or screen Dimension

Output

NameTypeDefaultDescription
widthnumbernullWidth of the Screen
heightnumbernullHeight of the Screen
fontScalenumbernullFont Scale of the Screen
scalenumbernullScale of the Screen

Contribution

  • @pritishvaidya The main author.

Questions

Feel free to contact me or create an issue

Keywords

react-native

FAQs

Package last updated on 25 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts