Loading video...

Video Failed to Load

Go Home

💡React tip: Use a custom hook to handle array states in your components

119,681 views • 2 years ago •via X (Twitter)

11 Comments

George Moller's profile picture
George Moller2 years ago

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics just like this one. Check them out ↓

George Moller's profile picture
George Moller2 years ago

I've been working professionally with React for more than 8 years and I compiled all my knowledge into 100+ infographics just like this one. Check them out ↓

Matej Bendík's profile picture
Matej Bendík2 years ago

Splitting logic into more reusable components / hooks is why we use React. Great explanation, George 👊

George Moller's profile picture
George Moller2 years ago

I love how easy it is to reuse/encapsulate logic in React.

Shripal Soni's profile picture
Shripal Soni2 years ago

Cool tip. I have never done this before ✨

George Moller's profile picture
George Moller2 years ago

It's quite useful to abstract those array helper methods in that way, try it out Shripal! :)

mlazos.eth's profile picture
mlazos.eth2 years ago

what is the idea of always returning an array of 2 elements in a hook instead of return an object {todos, add, remove} ?

Jennifer Tieu's profile picture
Jennifer Tieu2 years ago

I always appreciate your tips George🥺 and currently enjoying Design for Developers too, keep it up 🫡❤️

George Moller's profile picture
George Moller2 years ago

Thanks Jennifer! I'm really glad you enjoy the tweets, make me wanna continue pushing content ☺️ Also happy that you like Design for Developers 🙏 If you ever have questions or need help with anything please don't hesitate to reach out :)

Edgar Rodríguez's profile picture
Edgar Rodríguez2 years ago

Can’t believe I’ve consumed this pattern so many times and I never authored 🤯 Thank you for making it so obvious 😩🤌

George Moller's profile picture
George Moller2 years ago

Hey Edgar! just saw that you are building in public 💪 following your journey now :)

Related Videos