Learn how to avoid common pitfalls in React functional programming, such as unnecessary re-renders caused by inline functions as props and derived data from props. Embrace composition over inheritance for more reusable and maintainable code.
Table of contents
How to Do Functional Programming Right in 4 Key Points1. Don’t pass inline functions as props 🚫(even if you are using React.memo)2. Defining functions inside functional components (or as I call them, Russian Doll 🪆)3. Be aware of the danger of derived data from props ↘️4. Embracing Composition Over Inheritance2 Comments
Sort: