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

'render' should render, because that's what the function name says. If you're using it for behavior then you're not using it for the intended purpose.


Now that hooks exist, this should definitely be the case. Before, HoCs / components with render prop functions were actually useful for doing some additional not-directly-render related work.


You can now use hooks for some things you might previously want a component for, e.g. useFetch instead of <Fetch />, but don't agree "this should definitely be the case". Dogma is never good.


Strongly disagree, and 'because the function is called that' is a very poor reason.

You're not using React to its full potential if you think like this.




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

Search: