1.

What is the reason behind React native not automatically sizing everything?

Answer»

In Web development, if we don’t give a size to an element either via CSS or setting the width and height attribute of an element then elements size would be 0. There are a few instances where the size of the element is determined based on the size of children. For example, if you have an image element in div then initially height of div element is 0 and once the image is fetched from server browser again CALCULATED the size of div and place image INSIDE div. The user experience of this element is not very good as size keeps changing in between. If this div is placed in the middle of other div elements then the whole page will fluctuate to absorb the size of the image. To avoid this behaviour, REACT native have decided not to automatically CALCULATE the size of elements. INSTEAD, it completely depends on the developer to give the width and height of elements by CSS.



Discussion

No Comment Found