React Best Practices Comprehensive performance optimization and best practices for React applications, designed for AI agents and LLMs working with React code. NEVER Do React These are the most critical anti-patterns that cause real production issues. Experts learned these the hard way through debugging sessions and performance investigations. NEVER define components inside components — creates new component type on every render, causing full remount with state loss and DOM recreation. Results in input fields losing focus on keystroke, animations restarting unexpectedly, and useEffect cleanup…