Why Doesn't React Have Templates?
The way React does thing can be a little off-putting at first.
At first, it might seem like this goes against every best practice you know. But there are actually good reasons behind React’s choices. In this video, I explore these reasons and try to make sense of React’s lack of templating.
Although templating languages do have advantages (like easier
each loops and
This can admittedly result in code that’s harder to read and less approachable to non-programmers, compared to relatively straightforward templating syntaxes like Handlebars.
But by adopting newer React patterns like smart & dumb components and functional stateless components, you can bridge that gap and end up with components that are almost as easy to read as templates, while also being a lot more powerful.