Re:React best practices
by tacotacotaco on Monday May 03, 2021 @05:53PM
(#27031239)
No. This person seems not understand composition. This pattern can be useful but is poorly employed in this example. If you are interested in good practices please read Eric Elliot's Composing Software
https://medium.com/javascript-scene/composing-software-the-b...
[ Parent
| on HN ]
Re:React best practices
by zarathustreal on Monday May 03, 2021 @06:01PM
(#27031354)
100% this person is misusing composition. Especially in the React Component sense. There seems to be some key details of React missing from the original posters' understanding, and I highly recommend anyone reading this to look into functional programming to understand what a React component is and does and how to build higher-level abstractions like the one(s) mentioned by this original poster the correct way. Higher-order functions and a real state management library are the obvious solutions to these problems