What is Higher Order Component or HOC?
What is Higher Order Component or HOC?
A Higher-Order Component (HOC) is an advanced technique in React and React Native for reusing component logic. It is not a part of the React API but rather a pattern that emerges from React’s compositional nature. Concretely, a higher-order component is a function that takes a component as an argument and returns a new component with enhanced functionality.
Definition:
const EnhancedComponent = higherOrderComponent(WrappedComponent);.Purpose:
Common Use Cases:
Đăng nhập để tham gia thảo luận cùng mọi người.
Chưa có bình luận nào
Hãy là người đầu tiên chia sẻ suy nghĩ của bạn.