5 Tips Every React Developer Should Know Tapajyoti Bose on October 10, 2021 React is an amazing tool to build Front End Applications. This article will provide you some tips which you can immediately implement to up your Re... Read full post Submit Preview Dismiss Collapse Expand Peter Vivo Peter Vivo Peter Vivo Follow The Vibe Archeologist. Creator of hexaw + 3Draft |> and touch bar fanatic from Hungary. God speed you! 1John1 + 5John17 |> 1Moses1 = (1Moses2 ... 4.22John21); alpha & omega = !![]; Location Csobánka, Hungary Education streetwise Work full stack developer at TCS Joined Jul 24, 2020 • Oct 10 '21 Dropdown menu Copy link Hide I never try to check facebook with dev tools ... it was so interesting. Collapse Expand Tapajyoti Bose Tapajyoti Bose Tapajyoti Bose Follow Top Rated Freelancer || Blogger || Cross-Platform App Developer || Web Developer || Open Source Contributor Location Kolkata, West Bengal, India Joined Dec 4, 2020 • Oct 10 '21 Dropdown menu Copy link Hide :) Collapse Expand Damian Żygadło Damian Żygadło Damian Żygadło Follow This is the Cardinal Sin of Web Development right here. Location Poland Work Cardinal Sin of Web Development Joined Aug 16, 2020 • Oct 11 '21 Dropdown menu Copy link Hide HOC is deprecated. Collapse Expand Tapajyoti Bose Tapajyoti Bose Tapajyoti Bose Follow Top Rated Freelancer || Blogger || Cross-Platform App Developer || Web Developer || Open Source Contributor Location Kolkata, West Bengal, India Joined Dec 4, 2020 • Oct 11 '21 Dropdown menu Copy link Hide So what's the replacement for HOC? Collapse Expand Ahmed Ahmed Ahmed Follow Joined Jan 29, 2018 • Oct 13 '21 • Edited on Oct 13 • Edited Dropdown menu Copy link Hide I mean why use HOC and not just simplify it with a general Layout component So simply speaking: const Layout = ({children}) => { return ( <Header /> <main>{children}</main> <Footer /> ) } export default Layout; Enter fullscreen mode Exit fullscreen mode and than you can wrap any page or template you wish with your Layout component! Tapajyoti Bose Tapajyoti Bose Tapajyoti Bose Follow Top Rated Freelancer || Blogger || Cross-Platform App Developer || Web Developer || Open Source Contributor Location Kolkata, West Bengal, India Joined Dec 4, 2020 • Oct 13 '21 • Edited on Oct 13 • Edited Dropdown menu Copy link Hide Using the HOC is a more sleek solution. It still has the same issues as the HOC approach Paul McClean Paul McClean Paul McClean Follow Joined May 3, 2019 • Oct 14 '21 • Edited on Oct 14 • Edited Dropdown menu Copy link Hide "Sleek" is pretty subjective. I much prefer a layout component rendering child elements. It makes the HTML structure easier to read, in my opinion. Tapajyoti Bose Tapajyoti Bose Tapajyoti Bose Follow Top Rated Freelancer || Blogger || Cross-Platform App Developer || Web Developer || Open Source Contributor Location Kolkata, West Bengal, India Joined Dec 4, 2020 • Oct 15 '21 Dropdown menu Copy link Hide I do agree, "sleek" indeed is subjective Collapse Expand vladi160 vladi160 vladi160 Follow A dev since IE6 Location Sofia, Bulgaria Joined May 10, 2020 • Oct 12 '21 Dropdown menu Copy link Hide = <></> Collapse Expand jprly jprly jprly Follow Joined Oct 10, 2021 • Oct 10 '21 Dropdown menu Copy link Hide Great code examples, thank you! Collapse Expand Tapajyoti Bose Tapajyoti Bose Tapajyoti Bose Follow Top Rated Freelancer || Blogger || Cross-Platform App Developer || Web Developer || Open Source Contributor Location Kolkata, West Bengal, India Joined Dec 4, 2020 • Oct 11 '21 Dropdown menu Copy link Hide Glad you found it helpful! Code of Conduct • Report abuse
I never try to check facebook with dev tools ... it was so interesting.
:)
HOC is deprecated.
So what's the replacement for HOC?
I mean why use HOC and not just simplify it with a general Layout component
So simply speaking:
and than you can wrap any page or template you wish with your Layout component!
Using the HOC is a more sleek solution. It still has the same issues as the HOC approach
"Sleek" is pretty subjective. I much prefer a layout component rendering child elements. It makes the HTML structure easier to read, in my opinion.
I do agree, "sleek" indeed is subjective
= <></>
Great code examples, thank you!
Glad you found it helpful!