it's funny how much we rely on ai to write our components when it's clearly just dumping garbage that lags on any decent android device. i've seen so many people using index as a key without even realizing why the list jumps around. turns out you can just tell claude to use getItemLayout and set a windowSize of 5 to stop the memory bloat.
>Don't add libraries. Keep my naming.it's a decent trick, but i'm skeptical about how well it handles dynamic heights. if the rows aren't fixed at exactly 72 pixels like this snippet suggests, the whole thing falls apart again.
const ROW_HEIGHT = 72;< FlatList getItemLayout={ (_, index ) => ({ length: ROW_HEIGHT, offset: ROW_HEIGHT * index, index }) }does anyone actually use this prompt for anything more complex than a simple product list?
https://dev.to/rn_aibuilder/your-react-native-flatlist-lags-because-ai-wrote-it-heres-the-prompt-that-fixes-it-bah