Creating a custom Column using composition instead of inheritance?
See original GitHub issueAre there any plans to support using composition of Column
in Table
? Seems like Table
is very strict about children types seen here.
I ask because it seems like composition is preferred over inheritance in React… I want to create custom column components and right now I find myself having to extend Column
instead of React.Component
.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Composition vs. Inheritance: How to Choose? | Thoughtworks
Inheritance is transitive, so a class may inherit from another class which inherits from another class, and so on, up to a base...
Read more >Prefer composition over inheritance? - Stack Overflow
Prefer composition over inheritance as it is more malleable / easy to modify later, but do not use a compose-always approach. With composition,...
Read more >4 12 Composition vs Inheritance Building Flutter Widgets From ...
Composition vs Inheritance Building Flutter Widgets From ScratchInheritance and polymorphism in FlutterThe Flutter UI framework, ...
Read more >Composition over Inheritance, why not both?
Composition over Inheritance, why not both? The principle is correctly quoted as "prefer composition over inheritance".
Read more >Inheritance versus composition - LWN.net
With composition, one can create a class that has relationships with ... inheritance in coding & inheritance means reuse of codes instead of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Personally I think table should be changed to allow custom column components. React specifically discourages the use of inheritance, and anyway you can’t use it with functional components, which is the direction things are heading. One option might be to search descendants of children components and ensure that all leaves are
Columns
?I think we talked about this out of band (maybe over Slack?) I can’t recall. Anyway, I don’t think this is necessary.
You can extend
Column
, use acellRenderer
, or a shared factory method that creates pre-configuredColumn
instances for you. 👍