A deep dive into the Liskov Substitution Principle with examples, violations, and practical tips for writing scalable, bug-free object-oriented code.
This article walks through new CSS features like ::scroll-button()
and ::scroll-marker()
that make it possible to build fully functional CSS-only carousels.
Let’s talk about one of the greatest problems in software development: nascent developers bouncing off grouchy superiors into the arms of AI.
Flexbox and Grid are the heart of modern CSS layouts. Learn when to use each and how they help build flexible, responsive web designs — no more hacks or guesswork.
3 Replies to "How to migrate from HOCs to Hooks"
Great article.
Featured at https://reactdom.com/145
Nice article, i’m a react newbie i was wondering where should be placed the HOC (withScreenSize) and the custom hook, i mean should i create a folder called “hocs” and “hooks” to place these files in the project?
Hi!
If it’s a one-off hook, i would place it in the component file it was used. If it’s reused a lot, I’d pull it out into it’s own file and perhaps place that file in a utils folder.
To be honest, how you place your files doesn’t matter all that much. Do what feels right to you. 🤗