Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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

119,681 Aufrufe • vor 2 Jahren •via X (Twitter)

11 Kommentare

Profilbild von George Moller
George Mollervor 2 Jahren

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 ↓

Profilbild von George Moller
George Mollervor 2 Jahren

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 ↓

Profilbild von Matej Bendík
Matej Bendíkvor 2 Jahren

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

Profilbild von George Moller
George Mollervor 2 Jahren

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

Profilbild von Shripal Soni
Shripal Sonivor 2 Jahren

Cool tip. I have never done this before ✨

Profilbild von George Moller
George Mollervor 2 Jahren

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

Profilbild von mlazos.eth
mlazos.ethvor 2 Jahren

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

Profilbild von Jennifer Tieu
Jennifer Tieuvor 2 Jahren

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

Profilbild von George Moller
George Mollervor 2 Jahren

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 :)

Profilbild von Edgar Rodríguez
Edgar Rodríguezvor 2 Jahren

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

Profilbild von George Moller
George Mollervor 2 Jahren

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

Ähnliche Videos