Composition and Inheritance

1. Composition and Inheritance

Inheritance --> tính kề thừa của OOP

Composition --> không phải tính chất

Đều xuất phát từ bài toán reuse code ?

2. Hooks

https://www.velotio.com/engineering-blog/cleaner-efficient-code-with-hooks-and-functional-programming#:~:text=Wrapper%20Hell%20%2D,-If%20you're&text=React%20solves%20this%20problem%20of,a%20problem%20called%20Wrapper%20Hell.

  • Hard to reuse stateful logic between components.

Làm sao để reuse được flow tick --> Render props and HOC

  • Complex components become hard to understand

  • Classes confuses both people and machine : con trỏ this

Last updated

Was this helpful?