Respond Native equivalent to adaptation to size classes?

When developing for iOS in Swift, I can set properties and restrictions to apply them only to certain size classes. For example, I can change the width of the view to 200 if it is bounded horizontally, or 400 if it is regular horizontally. Or I can adapt the view of the stack to horizontal or vertical depending on the size class .

I checked the documentation and SO, and cannot find similar features in React Native. Does it exist? If so, how do I use it?

+6
source share
1 answer

This feature is not part of React Native, because React Native uses Yoga, a layout engine that is completely different from iOS’s auto-layout engine based on restrictions. With React Native, you can control sizes and margins using percentages depending on the width or height of the screen. This is similar to what we do to develop responsive web pages.

If you want to delve into this topic, I can offer you this article.

0
source

Source: https://habr.com/ru/post/1263885/


All Articles