Hello everyone,
I still don’t understand the difference between templating engines like jade, ejs, mustache and a framework like angular or a library like reactjs. Thanks for your response.
From a similar thread
React is built for rendering all of the UI for single-page apps - ie there is one HTML page, and the app sits inside it. Template engines like ejs and pug are just for rendering HTML pages, they have no concept of behaviour.
They work differently. So with React, when you write code using the framework, you never write any HTML. You can write the render part using something that looks like HTML (JSX), but that’s just basically a plain JS object with some syntactic sugar to make it look like HTML. React builds a model of what the HTML should be, in JS. When you apply updates to that (maybe an onClick prop that triggers a state change), it compares what you want to change with its model, then goes and does the HTML rendering/updating bit using that model.
React is not designed to just make arbitrary HTML pages. Template engines are. In theory you could make a React-like thing using say Pug, it’s just JS and you could wire it up (eg LoDash has a builtin templating engine, jQuery at least used to as well). But it gets super complex for large apps, and string-based stuff is normally super slow. Note React is designed to fix the problem of large JS apps generally being unmaintainable
Angular was written to make building interactive forms easier. Jade was written to render static HTML pages.