InterviewVault
Welcome back, Sujit Kumar Mishra
Admin
SK Mishra
Revision Mode
Document technical questions and best-practice answers.
What are the advantages of function based components as compared to class based components?
Advantages of Function-Based Components vs. Class-Based Components:
1: Easier to write and read: Function components are shorter and less complex than class components.
2: No ‘this’ keyword confusion: You don’t have to worry about using ‘this’, which can be tricky in class components.
3: Hooks make things simpler: Hooks allow you to use state and other features easily in function components.
4: Better code reuse: It’s easier to reuse logic and split code into smaller pieces with function components.
5: Faster performance: Function components can be faster and lighter because they don’t have extra overhead.
6: Modern and recommended: Function components are now the standard in React and most new features are built for them.