Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/height-and-width.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A component's height and width determine its size on the screen.

## Fixed Dimensions

The general way to set the dimensions of a component is by adding a fixed `width` and `height` to style. All dimensions in React Native are unitless, and represent density-independent pixels.
The general way to set the dimensions of a component is by adding a fixed `width` and `height` to style. All dimensions in React Native are not unitless it supports percentage and represents density-independent pixels.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the technical point of view dimensions in React Native are unitless - every method related to the dimensions will return an integer (not a string with unit, like for example in CSS) which is a density pixels value. Later in the process many different operations on that value can happen (for example: multiplication by Pixel Ratio, conversion).

For arranging views React Native uses Yoga layout which besides DP and percentage allow specifying "auto" as value (which is also a default). You can find more information about the supported values in the Yoga documentation.


```SnackPlayer name=Height%20and%20Width
import React from 'react';
Expand Down