DEV Community

Discussion on: 7 code smells in your React components

Collapse
 
awnton profile image
Anton Gunnarsson

Yeah, for me it's about reducing the complexity of all components and minimizing context switching but sometimes it might be the right thing to use a function. In my experience though it's better to either inline the JSX or move it to another component in the vast majority of cases. (Altough that component might still live in the same file if it's tightly coupled).