Every React Component in this Project is a Funtional Component killing Extensibility #826
Replies: 5 comments 16 replies
-
@fenbox @PrimmaAnna @shuashuai request for your inputs |
Beta Was this translation helpful? Give feedback.
-
The problem is that the entire code of the component is part of function definition and those are like temporary variables, killing extensibility. This also cause performance issues too - each time function get called, those variables need to be created. |
Beta Was this translation helpful? Give feedback.
-
When discussing scalability, it's important to identify scenarios and components that are suitable for scaling. It's not that functional components aren't suitable for extensibility. In fact, React Hooks provide a great way to achieve scalability through a more granular approach. By decoupling state and side-effect logic into independent Hooks, component code can be organized more efficiently, improving readability. For example, consider siteInfoStore mentioned in issue #829. It is a Hook similar to Redux. If implemented as a class component, the code size will typically be larger than a function component. However, by using Hooks, the code can be more concise and maintainable. So which scenarios are suitable for class components:
|
Beta Was this translation helpful? Give feedback.
-
Conclusion Answer fronted i.e. React web App has very strong coupling with webhooks which make it hard to move away from FCs. Now taking About Extensibility in Functional Programming @robinv8 @shuashuai request your inputs on conclusion. I will update this based on feedback |
Beta Was this translation helpful? Give feedback.
-
This is how react components are written in this project.
If I want to make few components having custom changes to existing components which only makes sense to my site but not at Apache answer level. I won't be able to extend them since they are written as functional components. If OOPS can be applied there, then I would be able to make my changes.
Beta Was this translation helpful? Give feedback.
All reactions