{"id":297,"date":"2023-09-18T10:45:24","date_gmt":"2023-09-18T10:45:24","guid":{"rendered":"https:\/\/www.orbesterinfotech.com\/blog\/?p=297"},"modified":"2023-09-18T10:45:24","modified_gmt":"2023-09-18T10:45:24","slug":"understanding-higher-order-components-in-react-js","status":"publish","type":"post","link":"https:\/\/www.orbesterinfotech.com\/blog\/understanding-higher-order-components-in-react-js\/","title":{"rendered":"Understanding higher-order components in React.js"},"content":{"rendered":"\n<p>Higher-order components (HOCs) are an advanced topic in React.js, often used by application development experts to streamline the code and make the development project more efficient. A HOC is a \u201cfunction that takes a component and returns a new component\u201d. It reuses component logic and follows one of the patterns.<\/p>\n\n\n\n<p>When do you use HOCs?<br>Let\u2019s say you have a box to which you want to add an outline color. A component would perform this activity. Now let\u2019s say you have ten similar boxes, each needing an outline color. You could hand-write code for each box, or use a HOC to create a function that provides an outline color for each.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Higher-order components (HOCs) are an advanced topic in React.js, often used by application development experts to streamline the code and make the development project more efficient. A HOC is a \u201cfunction that takes a component and returns a new component\u201d. It reuses component logic and follows one of the patterns. When do you use HOCs?Let\u2019s [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":299,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-297","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/297","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/comments?post=297"}],"version-history":[{"count":1,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions"}],"predecessor-version":[{"id":300,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/posts\/297\/revisions\/300"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/media\/299"}],"wp:attachment":[{"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/media?parent=297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/categories?post=297"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orbesterinfotech.com\/blog\/wp-json\/wp\/v2\/tags?post=297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}