正在加载视频...

视频加载失败

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

119,692 次观看 • 2 年前 •via X (Twitter)

11 条评论

George Moller 的头像
George Moller2 年前

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 的头像
George Moller2 年前

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 的头像
Matej Bendík2 年前

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

George Moller 的头像
George Moller2 年前

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

Shripal Soni 的头像
Shripal Soni2 年前

Cool tip. I have never done this before ✨

George Moller 的头像
George Moller2 年前

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

mlazos.eth 的头像
mlazos.eth2 年前

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 的头像
Jennifer Tieu2 年前

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

George Moller 的头像
George Moller2 年前

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 的头像
Edgar Rodríguez2 年前

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

George Moller 的头像
George Moller2 年前

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

相关视频