Unless otherwise specified, "node" in React native specs refers to any element implementing the Node Interface, and sometimes to its shadow DOM counterpart.
As you'll notice in the documentation, there are plenty of objects implementing the Node interface, like Attr, Comment, CDATASection or Character. However, when referring to a web page, the term "node" typically denominates the two most common type of nodes:
They are called nodes because the DOM is typically associated with a tree model in which each child element is represented as a ramification (a node) which can have subsequent children.
The aspect-ratio is a CSS @media specification defined as the ratio between width
and height
. In media queries it refers to the width
and height
of the viewport but it's also commonly used when refering to any media element (images, videos,...).
With regard to aspect ratio the general accepted terms are:
landscape
an element with a width
greater than height
portrait
an element with a height
greater than width
square
an element with equal height
and width
React native implements aspectRatio
as a non-standard property of "nodes" (not of viewport), defined as a number, allowing locking the ratio between width
and height
in place.
When you set aspectRatio
and one of width
and height
it will calculate the other one based on the aspectRatio
value.
An aspectRatio
value of 2
will attempt to size the node with having a height
two times smaller than the width
and a value of .2
will result in a node having a height
5 times bigger than the width
.
For future reference, whenever you find the existing React Native documentation ambiguous or simply too scarce, the best places to look for clarifications are:
- MDN - a friendly yet comprehensive library on all things web, curated through the joined effort of both large teams (Mozilla, Google, Microsoft, Facebook and W3C) as well as individual web developers.
- the W3C standards. That's what is commonly named "official standard" or "standard specification".
Because web is made up of multiple different technologies, W3C can quickly become overwhelming. However, MDN pages always contain links to the relevant standards, where applicable.
Note: do not mistake W3C (the World Wide Web Consortium) for w3schools. The latter is a private website trying to monetize traffic made by developers in search of the "official standard". A somewhat harmless tick.