re: React Anti-pattern: renderThing VIEW POST

TOP OF THREAD FULL DISCUSSION
re: Not using classes (but functional components and hooks) will automatically save you from such solutions.
 

Would you share more how "function components + hooks" can save one from having renderThings?

 

What you did there is basically extracting the return value of your renderThings function. The only way with FC to couple that value inside the component is to store it in a local variable which feels illegal enough for me to not to do it. This would also enforce a pattern like const renderThing = () => {} where I would immediately see that it is the component itself and I just have to rename it to Thing.

code of conduct - report abuse