3 ms·
'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.
by interlocutor 7y ago
'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.
- thatswrong0 7y agoNow 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.
- allover 7y agoYou 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.
- allover 7y agoStrongly 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.