Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

- React Table is not an HOC - React may still show educational materials about HOC's but hooks replace their use-cases in almost every situation. - I don't see how HOC's are attempting to draw more separation of concerns between the traditional Markup/Logic/Style debate. They were simply the best solution at the time for creating reusable logic.


I've edited my comment.

I've used HOCs to share behavior between React components in the past. You can also accomplish similar things with the Render Props pattern, depending on how you want to organize code. Using hooks is new to me. Anyway, my point is there has always been ways to factor out the behavior from React components. I'm pretty sure the reason they don't encourage factoring it out completely is so that DOM events are still handled in the domain of the UI, since they don't deal with types in your model.

https://reactjs.org/docs/render-props.html




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: