• Home
  • Author: Joanna

ScrollView performance improved – react native scrollview infinite scroll


Jak wiemy z dokumentacji React Native, ScrollView renderuje wszystkie swoje dzieci na raz, co przy du┼╝ej ich ilo┼Ťci mo┼╝e powodowa─ç problemy z wydajno┼Ťci─ů. Istnieje jednak spos├│b, by roz┼éo┼╝y─ç renderowanie du┼╝ej ilo┼Ťci danych w czasie tak, aby u┼╝ytkownik nie odczu┼é tych problem├│w. Mo┼╝emy wy┼Ťwietli─ç przyk┼éadowo 20 element├│w przy pierwszym wczytaniu danych i dodawa─ç kolejno nowe elementy w miar─Ö przewijania listy. Tak stworzymy “nieko┼äcz─ůce si─Ö” przewijanie, tzw. “infnite scroll”.

As we know from React Native documentation, ScrollView renders all of its children at once, which can cause performance problems with a large number of them. However, there is a way to spread in time rendering of large number of data, so that the user does not feel these problems. For example, we can display 20 items at the first time when load data and add new items one by one while scrolling the list. That’s how we’ll create “endless” scrolling, so-called “infnite scroll”.

Read More ScrollView performance improved – react native scrollview infinite scroll

How to set button width and height in React Native?


It often happens that we want to change the dimensions of the button, which by default is extended to the entire width of the parent element. While reducing its width is not a problem – it is enough to reduce the width of the parent, but changing the height is already problematic. The Button element has no style property, so apart from changing the text color on iOS and the background color on Android, we can not set much in it.

Read More How to set button width and height in React Native?