DEV Community

Discussion on: Stop Building Your UI Components like this❌

Collapse
 
harshkc profile image
Harsh Choudhary

Sorry but I disagree with your point, even when you are passing the props you need to manage state of the props yourself. Maybe you are manging in the parent component which will become clumsy because let's say some other state of the parent rerender the whole component will re-render which will render your reusable component because props changed.

Managing state locally in reusable component helps you with not only readabliity but also with performance plus you can memoize stuffs easily.