5 ms·
i don't know react. Can you elaborate what you mean using React as a templating language? Are you saying react can be used sans any business logic and purely
by jordache 9y ago
i don't know react. Can you elaborate what you mean using React as a templating language? Are you saying react can be used sans any business logic and purely for template interpolation?
- josteink 9y agoSimply put, React lets you do two things: * Generate a HTML/DOM based on a template and data. * Lets you efficiently update that DOM based on updates to the data and/or model (this is it's killer feature). But if you're just going to do the first thing (generate a HTML/DOM), you don't need most of React's feature set, and you certainly don't need to push heavy JS onto the client. For those cases, a much better approach (for both clients and SEO) is to just pre-render the DOM/HTML server-side and serve that without any need for any javascript client-side (which is what the similarly named module "Preact" does).
- TomMarius 9y agoJosteink said it excellently, my addition is that React itself is a view library that lets you update DOM easily based on some data, and the data (and the logic behind it) can be and often are completely separated from React components themselves.