What is Higher Order Component or HOC?

Technology Community › Category: React Native › What is Higher Order Component or HOC?
VietMX Staff asked 5 years ago

Higher Order Component (HOC) is useful when you want to inject additional behaviours to the existing Component. You can use HOC to inject:

  • React Lifecycle (eg. execute code in componentWillMount)
  • State (eg. react-redux’s connect)
  • Component (Parent Component, Child Component, Sibling Component)
  • Style