In previous post: React Native editable list I showed, how to edit data of single element on list. The edited data was saved to the component state, which allowed it to be displayed on the screen. However, when you close the application, the data resets and are not saved. How to change that? AsyncStorage will help.Read More React Native persist data. Saving and reading data from AsyncStorage
How to update parent state from child component in React Native ?
Passing data from child component to parent component is easy. When we place child component in parent’s content we must use function (sets in parent component and invoked in child component), which sets data in the parent’s component state, when action is made in child’s component, e.g. by clicking the button. The diagram is as follows:Read More How to pass data from child component to parent component in React Native?
The Modal component has many applications. Often it is used as a “window” in which you can perform additional actions, which results can be viewed on the screen. Modal can be used e.g. as a login window, information window or window with options to choose from.Read More React Native modal example
To edit the list, we need … a list 🙂 If you want to learn how to create a task list, see this post: Renering list in React NativeRead More React Native editable list – How to edit item data in a List
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
Ok, we want to display a list of items in React Native. We can do it in several ways, but here – two will be presented – ScrollView and FlatList.Read More React Native – Rendering Lists with ScrollView and FlatList
Setting the dimensions of elements used in React Native applications often causes problems. Therefore, we’ll look at several ways that will helps with better matching the view width and height relative to both – parent and screen.
Read More How to set view 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?