Common anti-patterns:
1. Anonymous functions in render:
1// ❌ Creates new function every render2<Button onPress={() => handlePress()} />34// ✅ Use useCallback5const handlePress = useCallback(() => {6 doSomething();7}, []);8<Button onPress={handlePress} />
2. Inline styles:
1// ❌ Creates new object every render2<View style={{ padding: 10 }} />34// ✅ Use StyleSheet5const styles = StyleSheet.create({ container: { padding: 10 } });6<View style={styles.container} />
3. Unnecessary re-renders:
4. Heavy computations in render: