3 ms·
I started out in React by putting all my actual render functions in separate files and linking them to the component in a similar way to this templating setup.
by Untit1ed 11y ago
I started out in React by putting all my actual render functions in separate files and linking them to the component in a similar way to this templating setup. It's a pretty natural reaction everyone has when first using JSX... but silly as it sounds, the annoyance of having long render functions in your components actually encourages you to split them up and end up with better code.
That said I never got over wanting nicer if/looping in JSX - if anyone else wants that compromise you can use the library I made to do it: https://github.com/valtech-au/jsx-control-statements https://github.com/valtech-au/jsx-control-statements.