How not scroll position after re render screen React native
How to stop ScrollView position changing after rendering the whole page. I have a ScrollView component of vertical scrolling of an online store. There are also nested FlatLists with product tiles, they have buttons for adding to cart, favorites and others. Each tile is dynamic and scrolls horizontally inside the FlatList. After clicking “Add to cart”, the element inside the FlatList is redrawn and the position of the parent ScrollView is reset. FlatList elements can also be updated from another screen, from the cart itself, so I pass the render function of this screen to other screens. I tried to get the Y position. But after rendering, the function for getting the position is called and Y becomes 0. I also tried to change the data by passing it to the FlatList component.