Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removing container View in renderItem
facebook#33180 (comment) >What's the reason for adding this cellStyle here? - we are adding a [View container][1] to each [cell][2] ([renderItem prop][3]) - `{flex: 1}` makes the container View take the full width of the parent container https://reactnative.dev/docs/flexbox#flex >[flex](https://reactnative.dev/docs/layout-props#flex) will define how your items are going to “fill” over the available space along your main axis. Space will be divided according to each element's flex property. | without `{flex: 1}` | with `{flex: 1}` | |:-------------------------:|:-------------------------:| | <img src="https://user-images.githubusercontent.com/24992535/157849508-1958558b-f3b1-4ae1-ab4e-a36c1991ad78.png" width="250" />| <img src="https://user-images.githubusercontent.com/24992535/157849671-7382a7a8-3299-4b88-ab94-7b1c5b8eb9ec.png" width="250" /> | [1]: https://github.com/fabriziobertoglio1987/react-native/blob/70e83a2cbb4f81ea373f3876abd9caf9f35a50a3/Libraries/Lists/FlatList.js#L628-L630 "the View container added to each cell" [2]: https://github.com/fabriziobertoglio1987/react-native/blob/70e83a2cbb4f81ea373f3876abd9caf9f35a50a3/Libraries/Lists/FlatList.js#L581-L601 "the logic responsible to render cells (renderItem prop)" [3]: https://reactnative.dev/docs/next/flatlist#required-renderitem "renderItem prop" original post fabOnReact/react-native-notes#6 (comment)
- Loading branch information