DEV Community

Discussion on: Why apply Open/Closed principles in React component composition?

Collapse
 
rudolfcicko2 profile image
Rudolf Cicko

I am really curious about the Liskov's substitution because I think it's the one that might be more complicated but I imagine, due to React's nature, instead of OOP, would be a compositional solution. Having a more generic component, or a HOC, and creating components based on them.

Collapse
 
shadid12 profile image
Shadid Haque • Edited

Yes I totally agree. I was recently doing some research on functional design patterns on React and how to use them. In my day job we started experimenting with higher order functional components and higher order functions as hooks as well. Probably will drop a blog post on that soon :)